From 1f7316f6e5b851f8b1f7fed49e444046614b94e4 Mon Sep 17 00:00:00 2001 From: Tim Harder Date: Wed, 31 Mar 2021 12:17:59 -0600 Subject: pkgdev showkw: initial import, moved from pkgcore's pshowkw --- tests/scripts/test_pkgdev_showkw.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/scripts/test_pkgdev_showkw.py (limited to 'tests') diff --git a/tests/scripts/test_pkgdev_showkw.py b/tests/scripts/test_pkgdev_showkw.py new file mode 100644 index 0000000..635cb69 --- /dev/null +++ b/tests/scripts/test_pkgdev_showkw.py @@ -0,0 +1,19 @@ +import pytest + + +class TestPkgdevShowkwParseArgs: + + def test_missing_target(self, capsys, tool): + with pytest.raises(SystemExit): + tool.parse_args(['showkw']) + captured = capsys.readouterr() + assert captured.err.strip() == ( + 'pkgdev showkw: error: missing target argument and not in a supported repo') + + def test_unknown_arches(self, capsys, tool, make_repo): + repo = make_repo(arches=['amd64']) + with pytest.raises(SystemExit): + tool.parse_args(['showkw', '-a', 'unknown', '-r', repo.location]) + captured = capsys.readouterr() + assert captured.err.strip() == ( + "pkgdev showkw: error: unknown arch: 'unknown' (choices: amd64)") -- cgit v1.2.3-65-gdbad