Add override api support.
More apis are added in this version.
This commit is contained in:
1 parent
f029ba425b
commit
e3e406a5bc
18 files changed
+451
-14
No files matched your search
@@ -49,6 +49,31 @@ def plugin_dialog(tmp_path):
|
||||
qt_app.processEvents()
|
||||
|
||||
|
||||
def test_plugin_warning_is_translated_and_saved_once(plugin_dialog):
|
||||
dialog = plugin_dialog
|
||||
dialog.app.i18n.set_language("zh-TW")
|
||||
messages = []
|
||||
dialog.app.widget_manager.signal.show_warning_message.connect(messages.append)
|
||||
dialog._show_plugin_warning()
|
||||
dialog._show_plugin_warning()
|
||||
assert len(messages) == 1
|
||||
assert "可信來源" in messages[0]
|
||||
dialog.app.settings_manager.load()
|
||||
assert dialog.app.settings_manager.get("plugins", PluginSettings).is_plugin_warning_shown
|
||||
dialog._show_plugin_warning()
|
||||
assert len(messages) == 1
|
||||
|
||||
|
||||
def test_plugin_warning_save_failure_does_not_repeat(plugin_dialog, monkeypatch):
|
||||
dialog = plugin_dialog
|
||||
monkeypatch.setattr(dialog.app.settings_manager, "save", Mock(side_effect=OSError("read only")))
|
||||
messages = []
|
||||
dialog.app.widget_manager.signal.show_warning_message.connect(messages.append)
|
||||
dialog._show_plugin_warning()
|
||||
dialog._show_plugin_warning()
|
||||
assert len(messages) == 1
|
||||
|
||||
|
||||
def test_search_filter_and_selection(plugin_dialog):
|
||||
dialog = plugin_dialog
|
||||
assert dialog.plugin_list.count() == 2
|
||||
|
||||
@@ -85,7 +85,7 @@ def test_invalid_theme_falls_back_to_default_styles(style_app):
|
||||
assert style_app.locate_styles_path(Path("main.qss")) == default
|
||||
|
||||
|
||||
@pytest.mark.parametrize("theme, background", [("aqua", "#f1f3f7"), ("windows-9x", "#c0c0c0"), ("bliss", "#ece9d8")])
|
||||
@pytest.mark.parametrize("theme, background", [("aqua", "#f1f3f7"), ("windows-9x", "#c0c0c0"), ("bliss", "#ece9d8"), ("it-looks-like-official-launcher", "#262626")])
|
||||
def test_message_boxes_follow_application_theme(style_app, theme, background):
|
||||
style_app.theme_dir = Path(__file__).resolve().parents[1] / "resources/themes" / theme
|
||||
style_app.apply_theme("custom")
|
||||
@@ -146,7 +146,7 @@ def test_detailed_dialogs_inherit_aqua(style_app, monkeypatch, question):
|
||||
assert checked == [True]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("theme, normal_color", [("aqua", "#626d7e"), ("windows-9x", "#404040"), ("bliss", "#555d69")])
|
||||
@pytest.mark.parametrize("theme, normal_color", [("aqua", "#626d7e"), ("windows-9x", "#404040"), ("bliss", "#555d69"), ("it-looks-like-official-launcher", "#b1b1b1")])
|
||||
@pytest.mark.parametrize("managed", [False, True])
|
||||
def test_profile_label_colors_follow_button_state(style_app, theme, normal_color, managed):
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
|
||||
Reference in new issue
Block a user