aboutsummaryrefslogtreecommitdiff
path: root/tests/test_mainwindow_list_actions.py
diff options
context:
space:
mode:
authorBrianna Rainey2026-02-12 15:38:54 -0500
committerGitHub2026-02-12 15:38:54 -0500
commitf03a3a686c7304588dd434322c73506531e53595 (patch)
treeee41d920873e9a77c41f4a65857af019e71a4754 /tests/test_mainwindow_list_actions.py
parent48a9105eab94e64101470402427564203e1d8970 (diff)
v2.2.4 - Quiet FFmpeg; add "invert" option to Classic Vis; fix CLI parsing for Image component (#96)
* change noisiness of terminal output ffmpeg no longer prints everything into the terminal unless we're in `--verbose` mode. percentage progress text stays on one line while not in verbose mode. * Added hint to run `avp --verbose` if `avp --log` is run with no avp_debug.log file present * Classic Visualizer: add invert option * Image component: fix path commandline option * Image component: restrict file formats in CLI to match GUI * Color component: add tooltip to color2 picker (second color of gradients) * change tests to work with pytest-xdist avp core stores its config (location of `settings.ini`) in temp directories if using multiple workers to run tests, so they don't interfere with each other. when using a single worker, the `tests/data/config` directory is still used * check alt comp names when parsing cmdline * rename `original.py` to `classic.py` * move `component.py` into subpackage * rename comp_original to comp_classic * show traceback if renderFrame() raises exception * do not try to insert non-existent components from project files * add "composite" property for components if a component returns "composite" then it will receive a frame to draw on during calls to previewRender and frameRender * more tests of projects, actions, waveform, spectrum, image, color, classic * do not change presetDir to "projects" within PresetManager
Diffstat (limited to 'tests/test_mainwindow_list_actions.py')
-rw-r--r--tests/test_mainwindow_list_actions.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/test_mainwindow_list_actions.py b/tests/test_mainwindow_list_actions.py
new file mode 100644
index 0000000..5f8bde4
--- /dev/null
+++ b/tests/test_mainwindow_list_actions.py
@@ -0,0 +1,52 @@
+"""Tests of `actions.py` - MainWindow component list manipulation via undoable actions"""
+
+from PyQt6 import QtCore
+import os
+from pytest import fixture
+from pytestqt import qtbot
+from . import getTestDataPath, window
+
+
+def test_mainwindow_addComponent(qtbot, window):
+ window.compMenu.actions()[0].trigger()
+ assert len(window.core.selectedComponents) == 1
+
+
+def test_mainwindow_removeComponent(qtbot, window):
+ window.compMenu.actions()[0].trigger() # add component
+ window.pushButton_removeComponent.click() # remove it
+ assert len(window.core.selectedComponents) == 0
+
+
+def test_mainwindow_moveComponent(qtbot, window):
+ # add first two components from menu
+ window.compMenu.actions()[0].trigger()
+ window.compMenu.actions()[1].trigger()
+ comp0 = window.core.selectedComponents[0].ui
+ window.pushButton_listMoveDown.click()
+ # check if 0 is now 1
+ assert window.core.selectedComponents[1].ui == comp0
+
+
+def test_mainwindow_addComponent_undo(qtbot, window):
+ window.compMenu.actions()[0].trigger()
+ window.undoStack.undo()
+ assert len(window.core.selectedComponents) == 0
+
+
+def test_mainwindow_removeComponent_undo(qtbot, window):
+ window.compMenu.actions()[0].trigger() # add component
+ window.pushButton_removeComponent.click() # remove it
+ window.undoStack.undo()
+ assert len(window.core.selectedComponents) == 1
+
+
+def test_mainwindow_moveComponent_undo(qtbot, window):
+ # add first two components from menu
+ window.compMenu.actions()[0].trigger()
+ window.compMenu.actions()[1].trigger()
+ comp0 = window.core.selectedComponents[0].ui
+ window.pushButton_listMoveDown.click()
+ window.undoStack.undo()
+ # check if 0 is still 0 after undo
+ assert window.core.selectedComponents[1].ui != comp0