Avoid starting Borg thread at the end of test. (#465)

This commit is contained in:
Manu 2020-05-22 20:49:04 +08:00 committed by GitHub
parent a765c32681
commit 4c50c99a4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -101,12 +101,10 @@ def test_archive_mount(qapp, qtbot, mocker, borg_json_output, monkeypatch, choos
)
qtbot.mouseClick(tab.mountButton, QtCore.Qt.LeftButton)
qtbot.waitUntil(lambda: tab.mountErrors.text().startswith('Mounted'), timeout=5000)
qtbot.waitUntil(lambda: tab.mountErrors.text().startswith('Mounted'), timeout=10000)
qtbot.mouseClick(tab.mountButton, QtCore.Qt.LeftButton)
# qtbot.waitUntil(lambda: tab.mountErrors.text() == 'No active Borg mounts found.')
qtbot.waitUntil(lambda: tab.mountErrors.text().startswith('Un-mounted successfully.'), timeout=5000)
qtbot.waitUntil(lambda: tab.mountErrors.text().startswith('Un-mounted successfully.'), timeout=10000)
def test_archive_extract(qapp, qtbot, mocker, borg_json_output, monkeypatch):
@ -127,12 +125,11 @@ def test_archive_extract(qapp, qtbot, mocker, borg_json_output, monkeypatch):
mocker.patch.object(vorta.borg.borg_thread, 'Popen', return_value=popen_result)
qtbot.mouseClick(tab.extractButton, QtCore.Qt.LeftButton)
qtbot.waitUntil(lambda: hasattr(tab, '_window'), timeout=5000)
qtbot.waitUntil(lambda: hasattr(tab, '_window'), timeout=10000)
assert tab._window.treeView.model().rootItem.childItems[0].data(0) == 'Users'
tab._window.treeView.model().rootItem.childItems[0].load_children()
assert tab._window.archiveNameLabel.text().startswith('test-archive, 2000')
tab._window.accept()
def test_archive_diff(qapp, qtbot, mocker, borg_json_output, monkeypatch):