From d988c3683faf5fe37a27638a6138ce1b9c516d1e Mon Sep 17 00:00:00 2001 From: miro Date: Thu, 19 Sep 2024 00:14:30 +0100 Subject: [PATCH] fix:cache_gui_files companion to https://github.com/OpenVoiceOS/ovos-gui/pull/53 and https://github.com/OpenVoiceOS/ovos-bus-client/pull/120 this should be merged first as it does not require the others to work and does not break anything in the wild --- requirements/requirements.txt | 2 +- test/unittests/skills/test_base.py | 41 ------------------------------ 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 2a94bfb..06bd601 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,5 +1,5 @@ ovos-utils>=0.0.38,<1.0.0 -ovos_bus_client>=0.0.8,<1.0.0 +ovos_bus_client>=0.0.8,<2.0.0 ovos-config>=0.0.12,<1.0.0 ovos-backend-client>=0.1.0,<2.0.0 ovos-lingua-franca>=0.4.6,<1.0.0 diff --git a/test/unittests/skills/test_base.py b/test/unittests/skills/test_base.py index c81d3ef..5758941 100644 --- a/test/unittests/skills/test_base.py +++ b/test/unittests/skills/test_base.py @@ -541,44 +541,3 @@ def test_get_scheduled_event_status(self): def test_cancel_all_repeating_events(self): # TODO pass - - -class TestSkillGui(unittest.TestCase): - class LegacySkill(Mock): - skill_id = "old_skill" - bus = FakeBus() - config_core = {"gui": {"test": True, - "legacy": True}} - root_dir = join(dirname(__file__), "test_gui/gui") - - class GuiSkill(Mock): - skill_id = "new_skill" - bus = FakeBus() - config_core = {"gui": {"test": True, - "legacy": False}} - root_dir = join(dirname(__file__), "test_gui") - - @patch("ovos_workshop.skills.ovos.GUIInterface.__init__") - def test_skill_gui(self, interface_init): - from ovos_bus_client.apis.gui import GUIInterface - from ovos_workshop.skills.base import SkillGUI - - # Old skill with `ui` directory in root - old_skill = self.LegacySkill() - old_gui = SkillGUI(old_skill) - self.assertEqual(old_gui.skill, old_skill) - self.assertIsInstance(old_gui, GUIInterface) - interface_init.assert_called_once_with( - old_gui, skill_id=old_skill.skill_id, bus=old_skill.bus, - config=old_skill.config_core['gui'], - ui_directories={"qt5": join(old_skill.root_dir, "ui")}) - - # New skill with `gui` directory in root - new_skill = self.GuiSkill() - new_gui = SkillGUI(new_skill) - self.assertEqual(new_gui.skill, new_skill) - self.assertIsInstance(new_gui, GUIInterface) - interface_init.assert_called_with( - new_gui, skill_id=new_skill.skill_id, bus=new_skill.bus, - config=new_skill.config_core['gui'], - ui_directories={"all": join(new_skill.root_dir, "gui")})