aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_commandline_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/test_commandline_parser.py')
-rw-r--r--src/tests/test_commandline_parser.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/tests/test_commandline_parser.py b/src/tests/test_commandline_parser.py
new file mode 100644
index 0000000..d672441
--- /dev/null
+++ b/src/tests/test_commandline_parser.py
@@ -0,0 +1,39 @@
+import sys
+import pytest
+from .__init__ import command
+
+
+def test_commandline_help(command):
+ sys.argv = ['', '--help']
+ with pytest.raises(SystemExit):
+ command.parseArgs()
+
+
+def test_commandline_help_if_bad_args(command):
+ sys.argv = ['', '--junk']
+ with pytest.raises(SystemExit):
+ command.parseArgs()
+
+
+def test_commandline_launches_gui_if_debug(command):
+ sys.argv = ['', '--debug']
+ mode = command.parseArgs()
+ assert mode == "GUI"
+
+
+def test_commandline_launches_gui_if_debug_with_project(command):
+ sys.argv = ['', 'test', '--debug']
+ mode = command.parseArgs()
+ assert mode == "GUI"
+
+
+def test_commandline_export_creates_audio_visualization(command):
+ didCallFunction = False
+ def captureFunction(*args):
+ nonlocal didCallFunction
+ didCallFunction = True
+
+ sys.argv = ['', '-c', '0', 'classic', '-i', '_', '-o', '_']
+ command.createAudioVisualisation = captureFunction
+ command.parseArgs()
+ assert didCallFunction
0c1927e3a2ab0a3f29fdf2b35b1aca22e22&follow=1'>refactor: only run `newsboat -x reload` when no instance of newsboat is runningBlista Kanjo1-3/+4 2023-07-18feat: trying out some `dwmblocks`-style widgetsBlista Kanjo8-0/+76 2023-07-18refactor: removed `ln=uu-ln` aliasBlista Kanjo1-4/+1 2023-07-17fix: syntax errors in `README.md`Blista Kanjo1-2/+2 2023-07-17refactor: update READMEBlista Kanjo1-2/+3 2023-07-17refactor: using the `rust coreutils` againBlista Kanjo1-6/+19 2023-07-14refactor: removed outdated comments`Blista Kanjo1-2/+0 2023-07-14refactor: move emoji picker to `~/.local/bin/`Blista Kanjo2-1/+1 2023-07-14refactor: revert away from `autorandr`Blista Kanjo1-8/+2 2023-07-14refactor: changes related to smaller `wibar`Blista Kanjo2-4/+4 2023-07-14feat: utilize `autorandr` if availableBlista Kanjo1-4/+7 2023-07-14refactor: align with `kj_sh604/laptop-dotfiles`Blista Kanjo1-71/+77 2023-07-14refactor: revert to basic `awesome-xrandr` scriptBlista Kanjo1-34/+8