2018-11-30 00:40:18 +00:00
|
|
|
import logging
|
|
|
|
from PyQt5 import QtCore
|
|
|
|
import vorta.models
|
2018-12-04 02:58:12 +00:00
|
|
|
import vorta.views
|
2018-11-30 00:40:18 +00:00
|
|
|
|
|
|
|
|
2018-12-05 09:05:47 +00:00
|
|
|
def test_add_folder(app, qtbot, tmpdir, monkeypatch, choose_file_dialog):
|
2018-12-04 02:58:12 +00:00
|
|
|
monkeypatch.setattr(
|
2018-12-05 09:05:47 +00:00
|
|
|
vorta.views.source_tab, "choose_file_dialog", choose_file_dialog
|
2018-12-04 02:58:12 +00:00
|
|
|
)
|
2018-11-30 00:40:18 +00:00
|
|
|
main = app.main_window
|
|
|
|
main.tabWidget.setCurrentIndex(1)
|
|
|
|
tab = main.sourceTab
|
|
|
|
|
|
|
|
qtbot.mouseClick(tab.sourceAddFolder, QtCore.Qt.LeftButton)
|
2018-12-05 09:05:47 +00:00
|
|
|
qtbot.waitUntil(lambda: tab.sourceFilesWidget.count() == 2)
|
2018-11-30 00:40:18 +00:00
|
|
|
|
2018-12-05 09:05:47 +00:00
|
|
|
for src in vorta.models.SourceFileModel.select():
|
2018-11-30 00:40:18 +00:00
|
|
|
logging.error(src.dir, src.profile)
|