diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-08-29 18:23:14 -0300 |
---|---|---|
committer | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-08-29 18:59:53 -0300 |
commit | c1a35317fe4ebb82bf7d24dc5d8c171d29c9c501 (patch) | |
tree | 74878eaccf9ddce91b33284cd8ed5c67910a219a /service/test/unit/bitmask_libraries/test_provider.py | |
parent | 840ade44e23add85fbe97b79ee249fc7c1e6adf2 (diff) |
[#765] Move combined_ca_bundle to UA initialization
With this change we don't have to create the combined_ca_bundle
for every user at every login.
To support this change, we started migrating away from the
LeapCertificate class that was making the LeapProvider setup
more brittle
Diffstat (limited to 'service/test/unit/bitmask_libraries/test_provider.py')
-rw-r--r-- | service/test/unit/bitmask_libraries/test_provider.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/service/test/unit/bitmask_libraries/test_provider.py b/service/test/unit/bitmask_libraries/test_provider.py index 1284698f..4e7c565f 100644 --- a/service/test/unit/bitmask_libraries/test_provider.py +++ b/service/test/unit/bitmask_libraries/test_provider.py @@ -207,13 +207,12 @@ class LeapProviderTest(AbstractLeapTest): def test_that_provider_cert_is_used_to_fetch_soledad_json(self): get_func = MagicMock(wraps=requests.get) - LeapCertificate.provider_api_cert = PROVIDER_API_CERT with patch('pixelated.bitmask_libraries.provider.requests.get', new=get_func): with HTTMock(provider_json_mock, soledad_json_mock, not_found_mock): provider = LeapProvider('some-provider.test') provider.fetch_soledad_json() - get_func.assert_called_with('https://api.some-provider.test:4430/1/config/soledad-service.json', verify=PROVIDER_API_CERT, timeout=15) + get_func.assert_called_with('https://api.some-provider.test:4430/1/config/soledad-service.json', verify='/some/leap/home/providers/some-provider.test/keys/client/api.pem', timeout=15) def test_that_leap_fingerprint_is_validated(self): session = MagicMock(wraps=requests.session()) @@ -227,3 +226,10 @@ class LeapProviderTest(AbstractLeapTest): session.get.assert_any_call('https://some-provider.test/ca.crt', verify=False, timeout=15) session.mount.assert_called_with('https://', ANY) + + def test_provider_api_cert(self): + with HTTMock(provider_json_mock): + provider = LeapProvider('some-provider.test') + certs = provider.provider_api_cert + + self.assertEqual('/some/leap/home/providers/some-provider.test/keys/client/api.pem', certs) |