Skip to content

Commit

Permalink
Add more tests for uncovered lines
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca committed Jul 24, 2024
1 parent ab10d6b commit a5dc5c5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions napari_plugin_manager/_tests/test_installer_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ def environment(self, env=None):
return QProcessEnvironment.systemEnvironment()


def test_not_implemented_methods():
tool = AbstractInstallerTool('install', ['requests'])
with pytest.raises(NotImplementedError):
tool.executable()

with pytest.raises(NotImplementedError):
tool.arguments()

with pytest.raises(NotImplementedError):
tool.environment()

with pytest.raises(NotImplementedError):
tool.available()


def test_pip_installer_tasks(qtbot, tmp_virtualenv: 'Session', monkeypatch):
installer = InstallerQueue()
monkeypatch.setattr(
Expand Down Expand Up @@ -165,6 +180,17 @@ def test_installer_failures(qtbot, tmp_virtualenv: 'Session', monkeypatch):
)


def test_cancel_incorrect_job_id(qtbot, tmp_virtualenv: 'Session'):
installer = InstallerQueue()
with qtbot.waitSignal(installer.allFinished, timeout=20000):
job_id = installer.install(
tool=InstallerTools.PIP,
pkgs=['requests'],
)
with pytest.raises(ValueError):
installer.cancel(job_id + 1)


@pytest.mark.skipif(
not CondaInstallerTool.available(), reason="Conda is not available."
)
Expand Down

0 comments on commit a5dc5c5

Please sign in to comment.