diff --git a/ovos_workshop/app.py b/ovos_workshop/app.py index 98e2acf..6f0c811 100644 --- a/ovos_workshop/app.py +++ b/ovos_workshop/app.py @@ -13,9 +13,7 @@ class OVOSAbstractApplication(OVOSSkill): def __init__(self, skill_id: str, bus: Optional[MessageBusClient] = None, resources_dir: Optional[str] = None, - lang=None, settings: Optional[dict] = None, - gui: Optional[GUIInterface] = None, - enable_settings_manager: bool = False, **kwargs): + gui: Optional[GUIInterface] = None, **kwargs): """ Create an Application. An application is essentially a skill, but designed such that it may be run without an intent service. @@ -23,11 +21,7 @@ def __init__(self, skill_id: str, bus: Optional[MessageBusClient] = None, @param bus: MessageBusClient to bind to application @param resources_dir: optional root resource directory (else defaults to application `root_dir` - @param lang: DEPRECATED language of the application - @param settings: DEPRECATED settings object @param gui: GUIInterface to bind (if `None`, one is created) - @param enable_settings_manager: if True, enables a SettingsManager for - this application to manage default settings and backend sync """ self._dedicated_bus = False if bus: @@ -38,15 +32,7 @@ def __init__(self, skill_id: str, bus: Optional[MessageBusClient] = None, super().__init__(skill_id=skill_id, bus=bus, gui=gui, resources_dir=resources_dir, - enable_settings_manager=enable_settings_manager, **kwargs) - - if settings: - log_deprecation(f"Settings should be set in {self.settings_path}. " - f"Passing `settings` to __init__ is not supported.", - "0.1.0") - self.settings.merge(settings) - @property def settings_path(self) -> str: """ diff --git a/test/unittests/skills/test_base.py b/test/unittests/skills/test_base.py index 38ae5b5..de9a960 100644 --- a/test/unittests/skills/test_base.py +++ b/test/unittests/skills/test_base.py @@ -167,28 +167,18 @@ def test_upload_settings(self): pass def test_handle_settings_file_change(self): - real_upload = self.skill._upload_settings - self.skill._upload_settings = Mock() settings_file = self.skill.settings.path - # Handle change with no callback - self.skill._handle_settings_file_change(settings_file) - self.skill._upload_settings.assert_called_once() - # Handle change with callback - self.skill._upload_settings.reset_mock() self.skill.settings_change_callback = Mock() self.skill._handle_settings_file_change(settings_file) - self.skill._upload_settings.assert_called_once() self.skill.settings_change_callback.assert_called_once() # Handle non-settings file change self.skill._handle_settings_file_change(join(dirname(settings_file), "test.file")) - self.skill._upload_settings.assert_called_once() self.skill.settings_change_callback.assert_called_once() - self.skill._upload_settings = real_upload def test_load_lang(self): # TODO diff --git a/test/unittests/test_abstract_app.py b/test/unittests/test_abstract_app.py index 216f510..965f31e 100644 --- a/test/unittests/test_abstract_app.py +++ b/test/unittests/test_abstract_app.py @@ -19,33 +19,9 @@ def __int__(self, *args, **kwargs): class TestApp(unittest.TestCase): bus = FakeBus() - test_path = join(dirname(__file__), "test_config.json") - settings = {'test': True, - 'updated': False} - settings_obj = JsonStorage(test_path, True) - settings_obj.update(settings) - gui = GUIInterface("TestApplication") - app = Application(skill_id="TestApplication", settings=settings_obj, - gui=gui, bus=bus) - - def test_settings_manager_init(self): - self.assertIsNone(self.app.settings_manager) - - def test_settings_init(self): - self.assertNotEqual(self.app.settings, self.settings_obj) - self.assertFalse(self.app.settings['__mycroft_skill_firstrun']) - self.assertTrue(self.app.settings['test']) - self.assertFalse(self.app.settings['updated']) - self.settings_obj['updated'] = True - self.assertFalse(self.app.settings['updated']) - - def test_settings_init_invalid_arg(self): - app = Application(skill_id="TestApplication", bus=self.bus, - settings=self.settings) - self.assertNotEqual(app.settings, self.settings) - self.assertFalse(app.settings['__mycroft_skill_firstrun']) + app = Application(skill_id="TestApplication", gui=gui, bus=bus) def test_gui_init(self): self.assertEqual(self.app.gui, self.gui)