summaryrefslogtreecommitdiff
path: root/tests/test_arg_parser.py
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2023-08-21 23:45:14 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2023-08-21 23:45:14 -0600
commitffe145a6c67afed6fb68326edbc91cbd94a3f846 (patch)
tree8eb6f354beff2c35d1f823cf058f3fd4c74b49d0 /tests/test_arg_parser.py
parent5c3b2c158180aa47003c5e82857594afd0c2bd7b (diff)
feat: fuck it, delete tests
Diffstat (limited to 'tests/test_arg_parser.py')
-rw-r--r--tests/test_arg_parser.py42
1 files changed, 0 insertions, 42 deletions
diff --git a/tests/test_arg_parser.py b/tests/test_arg_parser.py
deleted file mode 100644
index e233e93..0000000
--- a/tests/test_arg_parser.py
+++ /dev/null
@@ -1,42 +0,0 @@
-import sys
-import pytest
-from unittest.mock import patch
-from argparse import ArgumentParser
-
-
-# these tests don't really show any coverage, so not sure how useful they're
-# but I'm including them as at least these should work
-@pytest.mark.parametrize('args, arg_name, exp_result', [
- (['--version'], 'version', True),
- (['-v'], 'version', True),
- # config really just inputs a string
- (['--config', 'value'], 'config', 'value'),
- (['-c', 'value'], 'config', 'value'),
- (['--copy-default-config'], 'copy_default_config', True),
- (['--init'], 'init', True),
- (['-i'], 'init', True),
- (['--build'], 'build', True),
- (['-b'], 'build', True),
- (['--debug'], 'debug', True)
-])
-def test_valid_args(args: list[str],
- arg_name: str,
- exp_result: str | bool,
- arg_parser: ArgumentParser) -> None:
- with patch.object(sys, 'argv', ['pyssg'] + args):
- parsed_args: dict[str, str | bool] = vars(arg_parser.parse_args())
- assert parsed_args[arg_name] == exp_result
-
-
-@pytest.mark.parametrize('args', [
- (['--something-random']),
- (['-z']),
- (['help']),
- (['h'])
-])
-def test_invalid_args(args: list[str],
- arg_parser: ArgumentParser) -> None:
- with pytest.raises(SystemExit) as system_exit:
- arg_parser.parse_args(args)
- assert system_exit.type == SystemExit
- assert system_exit.value.code == 2