mirror of
https://github.com/borgbase/vorta
synced 2024-12-22 07:43:09 +00:00
82844a17b4
* Improve macOS packaging, add notarization. * Properly use QApplication while testing, remove workarounds. * Use Github Workflows instead of Travis. * Remove outdated test workaround.
25 lines
1 KiB
Python
25 lines
1 KiB
Python
from datetime import datetime as dt, date, time
|
|
from PyQt5 import QtCore
|
|
|
|
|
|
def test_schedule_tab(qapp, qtbot):
|
|
main = qapp.main_window
|
|
tab = main.scheduleTab
|
|
qtbot.mouseClick(tab.scheduleApplyButton, QtCore.Qt.LeftButton)
|
|
assert tab.nextBackupDateTimeLabel.text() == 'None scheduled'
|
|
|
|
tab.scheduleIntervalRadio.setChecked(True)
|
|
tab.scheduleIntervalHours.setValue(5)
|
|
tab.scheduleIntervalMinutes.setValue(10)
|
|
qtbot.mouseClick(tab.scheduleApplyButton, QtCore.Qt.LeftButton)
|
|
assert tab.nextBackupDateTimeLabel.text().startswith('20')
|
|
|
|
tab.scheduleOffRadio.setChecked(True)
|
|
qtbot.mouseClick(tab.scheduleApplyButton, QtCore.Qt.LeftButton)
|
|
assert tab.nextBackupDateTimeLabel.text() == 'None scheduled'
|
|
|
|
tab.scheduleFixedRadio.setChecked(True)
|
|
tab.scheduleFixedTime.setTime(QtCore.QTime(23, 59))
|
|
qtbot.mouseClick(tab.scheduleApplyButton, QtCore.Qt.LeftButton)
|
|
next_backup = dt.combine(date.today(), time(23, 59))
|
|
assert tab.nextBackupDateTimeLabel.text() == next_backup.strftime('%Y-%m-%d %H:%M')
|