From 9dbb7b6ec34adb6a28180279895c888806f6e9de Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Wed, 3 Sep 2014 01:29:30 +0200 Subject: [PATCH] test_gpg.py: test PGP messages and plaintext --- tests/fixtures/gpg/message.asc | 6 ++++++ tests/fixtures/gpg/plaintext.txt | 1 + tests/test_gpg.py | 8 ++++++++ 3 files changed, 15 insertions(+) create mode 100644 tests/fixtures/gpg/message.asc create mode 100644 tests/fixtures/gpg/plaintext.txt diff --git a/tests/fixtures/gpg/message.asc b/tests/fixtures/gpg/message.asc new file mode 100644 index 00000000..5962eba0 --- /dev/null +++ b/tests/fixtures/gpg/message.asc @@ -0,0 +1,6 @@ +-----BEGIN PGP MESSAGE----- +Version: GnuPG v1 + +owE7LZXEEMIWKBWWmJOZYqWQl69bnJmel1hSWpTKBQA= +=JwM5 +-----END PGP MESSAGE----- diff --git a/tests/fixtures/gpg/plaintext.txt b/tests/fixtures/gpg/plaintext.txt new file mode 100644 index 00000000..c3e7f82c --- /dev/null +++ b/tests/fixtures/gpg/plaintext.txt @@ -0,0 +1 @@ +Valid: text/plain diff --git a/tests/test_gpg.py b/tests/test_gpg.py index 445eb460..7c051968 100755 --- a/tests/test_gpg.py +++ b/tests/test_gpg.py @@ -61,5 +61,13 @@ class GpgTest(DakTestCase): with self.assertRaises(GpgException): verify('gpg/expired-subkey.asc') + def test_message_assertion(self): + with self.assertRaises(GpgException): + verify('gpg/message.asc') + + def test_plain_assertion(self): + with self.assertRaises(GpgException): + verify('gpg/plaintext.txt') + if __name__ == '__main__': unittest.main() -- 2.39.5