2023-11-24 21:19:28 +00:00
|
|
|
from PyQt6 import QtCore
|
|
|
|
|
|
|
|
|
|
|
|
def test_exclusion_preview_populated(qapp, qtbot):
|
|
|
|
main = qapp.main_window
|
|
|
|
tab = main.sourceTab
|
|
|
|
main.tabWidget.setCurrentIndex(1)
|
|
|
|
|
|
|
|
qtbot.mouseClick(tab.bExclude, QtCore.Qt.MouseButton.LeftButton)
|
|
|
|
qtbot.mouseClick(tab._window.bAddPattern, QtCore.Qt.MouseButton.LeftButton)
|
|
|
|
|
|
|
|
qtbot.keyClicks(tab._window.customExclusionsList.viewport().focusWidget(), "custom pattern")
|
|
|
|
qtbot.keyClick(tab._window.customExclusionsList.viewport().focusWidget(), QtCore.Qt.Key.Key_Enter)
|
2024-06-28 10:43:51 +00:00
|
|
|
qtbot.waitUntil(lambda: "custom pattern" in tab._window.exclusionsPreviewText.toPlainText())
|
2023-11-24 21:19:28 +00:00
|
|
|
|
|
|
|
tab._window.tabWidget.setCurrentIndex(1)
|
|
|
|
|
|
|
|
tab._window.exclusionPresetsModel.itemFromIndex(tab._window.exclusionPresetsModel.index(0, 0)).setCheckState(
|
|
|
|
QtCore.Qt.CheckState.Checked
|
|
|
|
)
|
|
|
|
|
2024-06-28 10:43:51 +00:00
|
|
|
qtbot.waitUntil(lambda: "# chromium-cache" in tab._window.exclusionsPreviewText.toPlainText())
|
2023-11-24 21:19:28 +00:00
|
|
|
tab._window.tabWidget.setCurrentIndex(2)
|
|
|
|
|
|
|
|
qtbot.keyClicks(tab._window.rawExclusionsText, "test raw pattern 1")
|
|
|
|
qtbot.waitUntil(lambda: "test raw pattern 1\n" in tab._window.exclusionsPreviewText.toPlainText())
|
2024-06-28 10:43:51 +00:00
|
|
|
|
|
|
|
qtbot.mouseClick(tab.bExclude, QtCore.Qt.MouseButton.LeftButton)
|
|
|
|
qtbot.mouseClick(tab._window.bAddPatternExcludeIfPresent, QtCore.Qt.MouseButton.LeftButton)
|
|
|
|
|
|
|
|
qtbot.keyClicks(tab._window.excludeIfPresentList.viewport().focusWidget(), "exclude_if_present_file")
|
|
|
|
qtbot.keyClick(tab._window.excludeIfPresentList.viewport().focusWidget(), QtCore.Qt.Key.Key_Enter)
|
|
|
|
qtbot.waitUntil(lambda: "exclude_if_present_file" in tab._window.exclusionsPreviewText.toPlainText())
|