diff options
author | Michał Górny <mgorny@gentoo.org> | 2020-08-25 17:20:49 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-08-25 17:20:49 +0200 |
commit | f1c904feb96dac663fd3e93152c9febf8a8a640a (patch) | |
tree | 6c7d5c5f6e48a4e6fe60c58dbdd5301204be4cd8 /tests | |
parent | 992e6c972786a148ac3e5044a321772b7bae7fb1 (diff) | |
download | gemato-f1c904feb96dac663fd3e93152c9febf8a8a640a.tar.gz |
openpgp: Introduce a helper method to get WKD URL
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_openpgp.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_openpgp.py b/tests/test_openpgp.py index 51f9e16..815de7e 100644 --- a/tests/test_openpgp.py +++ b/tests/test_openpgp.py @@ -1514,3 +1514,19 @@ class OpenPGPForgedUnexpireRefreshTest(HKPServerTestCase): self.env.verify_file, f) except gemato.exceptions.OpenPGPNoImplementation as e: raise unittest.SkipTest(str(e)) + + +class WKDUrlTests(unittest.TestCase): + """Tests for get_wkd_url() helper""" + + def test_get_wkd_url(self): + self.assertEqual( + gemato.openpgp.OpenPGPEnvironment.get_wkd_url( + 'gemato@example.com'), + 'https://example.com/.well-known/openpgpkey/hu/' + '5x66h616iaskmnadrm86ndo6xnxbxjxb?l=gemato') + self.assertEqual( + gemato.openpgp.OpenPGPEnvironment.get_wkd_url( + 'Joe.Doe@Example.ORG'), + 'https://example.org/.well-known/openpgpkey/hu/' + 'iy9q119eutrkn8s1mk4r39qejnbu3n5q?l=Joe.Doe') |