2018-11-30 00:40:18 +00:00
|
|
|
import vorta.borg
|
|
|
|
import vorta.models
|
|
|
|
|
|
|
|
|
2020-03-03 05:19:36 +00:00
|
|
|
def test_scheduler_create_backup(qapp, qtbot, mocker, borg_json_output):
|
2018-11-30 00:40:18 +00:00
|
|
|
stdout, stderr = borg_json_output('create')
|
|
|
|
popen_result = mocker.MagicMock(stdout=stdout, stderr=stderr, returncode=0)
|
|
|
|
mocker.patch.object(vorta.borg.borg_thread, 'Popen', return_value=popen_result)
|
|
|
|
|
2020-03-03 05:19:36 +00:00
|
|
|
qapp.scheduler.create_backup(1)
|
2018-11-30 00:40:18 +00:00
|
|
|
|
|
|
|
qtbot.waitUntil(lambda: vorta.models.EventLogModel.select().count() == 2, timeout=5000)
|