Skip to content

Commit

Permalink
fixup! implemented tests for job running methods of gui.MainWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyTeichman committed May 8, 2024
1 parent a8a3f10 commit 8e802a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3312,8 +3312,7 @@ def test_cancel_job_running(self, main_window, mocker, monkeypatch):
func_name = "func_name"
worker = mocker.Mock(spec=gui_widgets.Worker)
monkeypatch.setattr(main_window, 'run_threaded_workers', mocker.Mock())
monkeypatch.setattr(main_window, 'job_queue', mocker.Mock(spec=Queue))
monkeypatch.setattr(main_window.job_queue, 'queue', [worker])
monkeypatch.setattr(main_window, 'job_queue', mocker.Mock(spec=Queue, queue=[worker]))

warning_message_box = mocker.patch.object(QtWidgets.QMessageBox, 'warning', create=True)

Expand All @@ -3334,8 +3333,7 @@ def test_cancel_job_queued(self, main_window, mocker, monkeypatch):
worker1 = mocker.Mock(spec=gui_widgets.Worker)
worker2 = mocker.Mock(spec=gui_widgets.Worker)
monkeypatch.setattr(main_window, 'run_threaded_workers', mocker.Mock())
monkeypatch.setattr(main_window, 'job_queue', mocker.Mock(spec=Queue))
monkeypatch.setattr(main_window.job_queue, 'queue', (worker1, worker2))
monkeypatch.setattr(main_window, 'job_queue', mocker.Mock(spec=Queue, queue=(worker1, worker2)))

main_window.cancel_job(index, func_name)

Expand Down

0 comments on commit 8e802a9

Please sign in to comment.