diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-09-16 13:29:26 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-09-16 13:29:26 +0200 |
commit | 660e0d9de3188bad894b73f7f0ae236d5313b715 (patch) | |
tree | 50a56346ba50aca367b52b083abb499eaa727081 /service/test | |
parent | d09c979351bdb88229bab5506143136396105b2f (diff) |
Add fingerprints to exception on mismatch
Diffstat (limited to 'service/test')
-rw-r--r-- | service/test/unit/bitmask_libraries/test_provider.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/service/test/unit/bitmask_libraries/test_provider.py b/service/test/unit/bitmask_libraries/test_provider.py index 1fe5a66d..72251f0d 100644 --- a/service/test/unit/bitmask_libraries/test_provider.py +++ b/service/test/unit/bitmask_libraries/test_provider.py @@ -188,9 +188,13 @@ class LeapProviderTest(AbstractLeapTest): provider.fetch_valid_certificate() def test_throw_exception_for_invalid_certificate(self): + expected_exception_message = 'Certificate fingerprints don\'t match [0123456789012345678901234567890123456789012345678901234567890123] vs [06e2300bdbc118c290eda0dc977c24080718f4eeca68c8b0ad431872a2baa22d]' + with HTTMock(provider_json_invalid_fingerprint_mock, ca_cert_mock, not_found_mock): provider = LeapProvider('some-provider.test', self.config) - self.assertRaises(Exception, provider.fetch_valid_certificate) + with self.assertRaises(Exception) as cm: + provider.fetch_valid_certificate() + self.assertEqual(expected_exception_message, cm.exception.message) def test_that_bootstrap_cert_is_used_to_fetch_certificate(self): session = MagicMock(wraps=requests.session()) |