Skip to content

Commit

Permalink
tests: avoid periodic updates to interfere with a test
Browse files Browse the repository at this point in the history
This one: test_415_template_vm_started
It tests if template start/stop triggered the updates available state
update. Suppress periodic update of the same.
  • Loading branch information
marmarek committed Oct 27, 2020
1 parent 33e0aa2 commit 4d7793c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,9 @@ def __init__(self, qt_app, qubes_app, dispatcher, parent=None):
self.progress = None

# Check Updates Timer
timer = QtCore.QTimer(self)
timer.timeout.connect(self.check_updates)
timer.start(1000 * 30) # 30s
self.timer = QtCore.QTimer(self)
self.timer.timeout.connect(self.check_updates)
self.timer.start(1000 * 30) # 30s
self.check_updates()

def keyPressEvent(self, event): # pylint: disable=invalid-name
Expand Down
1 change: 1 addition & 0 deletions qubesmanager/tests/test_qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,7 @@ def test_415_template_vm_started(self):
if target_vm_name:
break

self.dialog.timer.stop()
for i in range(self.dialog.table.rowCount()):
self._get_table_item(i, "State").update_vm_state =\
unittest.mock.Mock()
Expand Down

0 comments on commit 4d7793c

Please sign in to comment.