summaryrefslogtreecommitdiff
path: root/tests/test___init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test___init__.py')
-rw-r--r--tests/test___init__.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test___init__.py b/tests/test___init__.py
new file mode 100644
index 0000000..5a09584
--- /dev/null
+++ b/tests/test___init__.py
@@ -0,0 +1,15 @@
+import pytest # noqa
+import b4
+
+
+@pytest.mark.parametrize('source,expected', [
+ ('good-valid-trusted', (True, True, True, 'B6C41CE35664996C', '1623274836')),
+ ('good-valid-notrust', (True, True, False, 'B6C41CE35664996C', '1623274836')),
+ ('good-invalid-notrust', (True, False, False, 'B6C41CE35664996C', None)),
+ ('badsig', (False, False, False, 'B6C41CE35664996C', None)),
+ ('no-pubkey', (False, False, False, None, None)),
+])
+def test_check_gpg_status(source, expected):
+ with open(f'tests/samples/gpg-{source}.txt', 'r') as fh:
+ status = fh.read()
+ assert b4.check_gpg_status(status) == expected