def test_should_run_preference_widget_on_about_item_activate( self, menu, view, about): menu.about_item.activate() refresh_gui() about.set_transient_for.assert_called_once_with(view.widget) about.run.assert_called_once_with()
def test_should_run_preference_widget_on_preference_item_activate(self, menu, view, preference): menu.preference_item.activate() refresh_gui() preference.set_transient_for.assert_called_once_with(view.widget) preference.refresh_plugin.assert_called_once_with() preference.run.assert_called_once_with()
def test_should_run_preference_widget_on_preference_item_activate( self, menu, view, preference): menu.preference_item.activate() refresh_gui() preference.set_transient_for.assert_called_once_with(view.widget) preference.refresh_plugins.assert_called_once_with() preference.run.assert_called_once_with()
def test_should_call_plugin_view_when_menu_activate(self, view, trayicon_menu): trayicon_menu.show_item.activate() refresh_gui() view.show.assert_called_once_with() assert trayicon_menu.hide_item.get_visible() assert not trayicon_menu.show_item.get_visible()
def test_should_call_plugin_view_when_menu_activate( self, view, trayicon_menu): trayicon_menu.show_item.activate() refresh_gui() view.show.assert_called_once_with() assert trayicon_menu.hide_item.get_visible() assert not trayicon_menu.show_item.get_visible()
def test_activate_plugin_settings_button_when_plugin_has_settings( plugin_manager, config, lazy_proxy, plugin): plugin.plugin_object.is_activated = True plugin.plugin_object.has_settings = True setup_plugin_manager(plugin_manager, plugin) extension_stack = ExtensionStack(plugin_manager, config, lazy_proxy) extension_stack.refresh() refresh_gui(0) assert extension_stack.plugin_settings_button.get_sensitive() is True
def test_show_plugin_settings(plugin_manager, config, lazy_proxy, plugin): plugin.plugin_object.is_activated = True plugin.has_settings = True setup_plugin_manager(plugin_manager, plugin) view = Mock(widget='widget') lazy_proxy.side_effect = lambda name: view if name == 'view.preference' else None extension_stack = ExtensionStack(plugin_manager, config, lazy_proxy) extension_stack.refresh() extension_stack.plugin_settings_button.emit('clicked') refresh_gui(0) plugin.plugin_object.settings_window.return_value.set_transient_for( 'widget') plugin.plugin_object.settings_window.return_value.run.assert_called_once_with( )
def test_should_call_view_show_when_show_item_activate( self, view, trayicon_menu): trayicon_menu.show_item.activate() refresh_gui() view.show.assert_called_once_with()
def test_should_run_preference_widget_on_about_item_activate(self, menu, view, about): menu.about_item.activate() refresh_gui() about.set_transient_for.assert_called_once_with(view.widget) about.run.assert_called_once_with()
def test_should_call_view_show_when_show_item_activate(self, view, trayicon_menu): trayicon_menu.show_item.activate() refresh_gui() view.show.assert_called_once_with()