def test__load_hooks_settings__no_widget(prefs): hook_show_command = "on_show.sh" prefs.client.get_string.return_value = hook_show_command prefs.get_widget.return_value = None PrefsDialog._load_hooks_settings(prefs) prefs.client.get_string.assert_any_call(KEY("/hooks/show")) prefs.get_widget.assert_any_call("hook_show")
def test__load_hooks_settings__no_setting(prefs, widget): prefs.client.get_string.return_value = None prefs.get_widget.return_value = widget PrefsDialog._load_hooks_settings(prefs) prefs.client.get_string.assert_any_call(KEY("/hooks/show")) prefs.get_widget.assert_any_call("hook_show") assert not widget.set_active.called
def test__load_hooks_settings__works(prefs, widget): hook_show_command = "on_show.sh" prefs.client.get_string.return_value = hook_show_command prefs.get_widget.return_value = widget PrefsDialog._load_hooks_settings(prefs) prefs.client.get_string.assert_any_call(KEY("/hooks/show")) prefs.get_widget.assert_any_call("hook_show") widget.set_text.assert_called_once_with(hook_show_command)
def test__load_hooks_settings__called(prefs): def se(key): """side effect for correctly mocking load_configs""" if key == KEY('/general/window_halignment'): return 0 return None prefs.client.get_int.side_effect = se prefs.client.get_string.return_value = '' PrefsDialog.load_configs(prefs) assert prefs._load_hooks_settings.called assert prefs._load_default_shell_settings.called assert prefs._load_screen_settings.called
def show_prefs(self, *args): # TODO DBUS ONLY # TODO TRAY ONLY """Hides the main window and creates an instance of the Preferences window. """ self.hide() PrefsDialog(self.settings).show()
def show_prefs(self, *args): """Hides the main window and creates an instance of the Preferences window. """ self.hide() PrefsDialog().show()
def on_show_preferences(self, *args): self.notebook.guake.hide() PrefsDialog(self.settings).show()
def on_show_preferences(self, user_data): self.guake.hide() PrefsDialog(self.guake.settings).show()