aboutsummaryrefslogtreecommitdiff
path: root/tests/test_commandline_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_commandline_parser.py')
-rw-r--r--tests/test_commandline_parser.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/test_commandline_parser.py b/tests/test_commandline_parser.py
index 8b07b8c..d092072 100644
--- a/tests/test_commandline_parser.py
+++ b/tests/test_commandline_parser.py
@@ -1,37 +1,38 @@
import sys
import pytest
from avp.command import Command
+from pytestqt import qtbot
-def test_commandline_help():
+def test_commandline_help(qtbot):
command = Command()
sys.argv = ["", "--help"]
with pytest.raises(SystemExit):
command.parseArgs()
-def test_commandline_help_if_bad_args():
+def test_commandline_help_if_bad_args(qtbot):
command = Command()
sys.argv = ["", "--junk"]
with pytest.raises(SystemExit):
command.parseArgs()
-def test_commandline_launches_gui_if_verbose():
+def test_commandline_launches_gui_if_verbose(qtbot):
command = Command()
sys.argv = ["", "--verbose"]
mode = command.parseArgs()
assert mode == "GUI"
-def test_commandline_launches_gui_if_verbose_with_project():
+def test_commandline_launches_gui_if_verbose_with_project(qtbot):
command = Command()
sys.argv = ["", "test", "--verbose"]
mode = command.parseArgs()
assert mode == "GUI"
-def test_commandline_tries_to_export():
+def test_commandline_tries_to_export(qtbot):
command = Command()
didCallFunction = False
@@ -43,3 +44,13 @@ def test_commandline_tries_to_export():
command.createAudioVisualization = captureFunction
command.parseArgs()
assert didCallFunction
+
+
+def test_commandline_parses_classic_by_alias(qtbot):
+ command = Command()
+ assert command.parseCompName("original") == "Classic Visualizer"
+
+
+def test_commandline_parses_conway_by_name(qtbot):
+ command = Command()
+ assert command.parseCompName("conway") == "Conway's Game of Life"