diff options
author | Ruben Pollan <meskio@sindominio.net> | 2015-09-24 12:19:36 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2015-09-24 12:19:36 +0200 |
commit | 221be476ad1c5e54b371492557c49481134a65e4 (patch) | |
tree | aa1859da5f81a035f8a00a49007e1298f6765c71 /keymanager | |
parent | f94e3aff14295821d28be0dbf3f4b40df980271c (diff) | |
parent | b1ce91a02a08103eff65b16afb098f499c00f285 (diff) |
Merge branch 'fix_empty_string_ca_certs' into develop
Diffstat (limited to 'keymanager')
-rw-r--r-- | keymanager/src/leap/keymanager/__init__.py | 2 | ||||
-rw-r--r-- | keymanager/src/leap/keymanager/tests/test_keymanager.py | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/keymanager/src/leap/keymanager/__init__.py b/keymanager/src/leap/keymanager/__init__.py index e378c91..cf099bb 100644 --- a/keymanager/src/leap/keymanager/__init__.py +++ b/keymanager/src/leap/keymanager/__init__.py @@ -148,7 +148,7 @@ class KeyManager(object): if self._ca_cert_path == leap_ca_bundle: return self._ca_cert_path # don't merge file with itself - elif self._ca_cert_path is None: + elif not self._ca_cert_path: return leap_ca_bundle # file is auto deleted when python process ends diff --git a/keymanager/src/leap/keymanager/tests/test_keymanager.py b/keymanager/src/leap/keymanager/tests/test_keymanager.py index 7c00292..3b4aa0f 100644 --- a/keymanager/src/leap/keymanager/tests/test_keymanager.py +++ b/keymanager/src/leap/keymanager/tests/test_keymanager.py @@ -346,7 +346,18 @@ class KeyManagerKeyManagementTestCase(KeyManagerWithSoledadTestCase): verify=ca_bundle.where()) @inlineCallbacks - def test_fetch_key_uses_default_ca_bundle_if_also_set_as_ca_cert(self): + def test_fetch_key_uses_ca_bundle_if_empty_string_specified(self): + ca_cert_path = '' + km = self._key_manager(ca_cert_path=ca_cert_path) + get_mock = self._mock_get_response(km, PUBLIC_KEY_OTHER) + + yield km.fetch_key(ADDRESS_OTHER, REMOTE_KEY_URL, OpenPGPKey) + + get_mock.assert_called_once_with(REMOTE_KEY_URL, data=None, + verify=ca_bundle.where()) + + @inlineCallbacks + def test_fetch_key_uses_default_ca_bundle_if_also_set_as_ca_cert_path(self): ca_cert_path = ca_bundle.where() km = self._key_manager(ca_cert_path=ca_cert_path) get_mock = self._mock_get_response(km, PUBLIC_KEY_OTHER) |