예제 #1
0
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")
예제 #2
0
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
예제 #3
0
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
예제 #4
0
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")
예제 #5
0
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)
예제 #6
0
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)
예제 #7
0
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
예제 #8
0
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
예제 #9
0
 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()
예제 #10
0
파일: guake_app.py 프로젝트: pztrick/guake
 def show_prefs(self, *args):
     """Hides the main window and creates an instance of the
     Preferences window.
     """
     self.hide()
     PrefsDialog().show()
예제 #11
0
파일: callbacks.py 프로젝트: 0x29a/guake
 def on_show_preferences(self, *args):
     self.notebook.guake.hide()
     PrefsDialog(self.settings).show()
예제 #12
0
 def on_show_preferences(self, user_data):
     self.guake.hide()
     PrefsDialog(self.guake.settings).show()