Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca committed Jan 8, 2025
1 parent a6c76a7 commit 4fd1637
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions napari_plugin_manager/_tests/test_qt_plugin_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,10 @@ def test_shortcut_quit(plugin_dialog, qtbot):
assert not plugin_dialog.isVisible()


def test_export_plugins(plugin_dialog, tmp_path):
@pytest.mark.skipif(
not sys.platform.startswith('linux'), reason="Test works only on linux"
)
def test_export_plugins_button(plugin_dialog):
def _timer():
dialog = QApplication.activeModalWidget()
dialog.reject()
Expand All @@ -621,12 +624,17 @@ def _timer():
timer.start(4_000)
plugin_dialog.export_button.click()


def test_export_plugins(plugin_dialog, tmp_path):
plugins_file = 'plugins.txt'
plugin_dialog.export_plugins(str(tmp_path / plugins_file))
assert (tmp_path / plugins_file).exists()


def test_import_plugins(plugin_dialog, tmp_path, qtbot):
@pytest.mark.skipif(
not sys.platform.startswith('linux'), reason="Test works only on linux"
)
def test_import_plugins_button(plugin_dialog, tmp_path, qtbot):
def _timer():
dialog = QApplication.activeModalWidget()
dialog.reject()
Expand All @@ -641,3 +649,10 @@ def _timer():
path.write_text('requests\npyzenhub\n')
with qtbot.waitSignal(plugin_dialog.installer.allFinished, timeout=60_000):
plugin_dialog.import_plugins(str(path))


def test_import_plugins(plugin_dialog, tmp_path, qtbot):
path = tmp_path / 'plugins.txt'
path.write_text('requests\npyzenhub\n')
with qtbot.waitSignal(plugin_dialog.installer.allFinished, timeout=60_000):
plugin_dialog.import_plugins(str(path))

0 comments on commit 4fd1637

Please sign in to comment.