diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-09-13 15:30:47 -0300 |
---|---|---|
committer | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-09-13 15:30:47 -0300 |
commit | 8713e0bc40ae8b7251f58e570ecaf13511a97136 (patch) | |
tree | 1d758016b6a71160704c7ef8052253daac0d1c09 /service/test/unit | |
parent | 13190c695c1b58a1f28d2c1533c36c0353b0a438 (diff) |
[#778] Renaming get_key to be consistent with keymanager
Diffstat (limited to 'service/test/unit')
3 files changed, 5 insertions, 6 deletions
diff --git a/service/test/unit/extensions/test_keymanager_fetch_key.py b/service/test/unit/extensions/test_keymanager_fetch_key.py index 8998198d..ef7d67d2 100644 --- a/service/test/unit/extensions/test_keymanager_fetch_key.py +++ b/service/test/unit/extensions/test_keymanager_fetch_key.py @@ -20,7 +20,6 @@ from leap.keymanager import KeyManager from leap.keymanager.keys import KEY_ADDRESS_KEY, KEY_TYPE_KEY, KEY_ID_KEY, KEY_FINGERPRINT_KEY, KEY_DATA_KEY, KEY_PRIVATE_KEY, KEY_LENGTH_KEY, KEY_EXPIRY_DATE_KEY, KEY_FIRST_SEEN_AT_KEY, KEY_LAST_AUDITED_AT_KEY, KEY_VALIDATION_KEY, KEY_TAGS_KEY from leap.keymanager.openpgp import OpenPGPKey from leap.keymanager.errors import KeyNotFound -import pixelated.support.ext_keymanager_fetch_key from requests.exceptions import HTTPError diff --git a/service/test/unit/resources/test_keys_resources.py b/service/test/unit/resources/test_keys_resources.py index 91c286c9..a7c885ca 100644 --- a/service/test/unit/resources/test_keys_resources.py +++ b/service/test/unit/resources/test_keys_resources.py @@ -28,7 +28,7 @@ class TestKeysResource(unittest.TestCase): def test_returns_404_if_key_not_found(self): request = DummyRequest(['/keys']) request.addArg('search', 'some@inexistent.key') - when(self.keymanager).fetch_key('some@inexistent.key').thenReturn(defer.fail(KeyNotFound())) + when(self.keymanager).get_key('some@inexistent.key').thenReturn(defer.fail(KeyNotFound())) d = self.web.get(request) @@ -41,7 +41,7 @@ class TestKeysResource(unittest.TestCase): def test_returns_the_key_as_json_if_found(self): request = DummyRequest(['/keys']) request.addArg('search', 'some@key') - when(self.keymanager).fetch_key('some@key').thenReturn(defer.succeed(OpenPGPKey('some@key'))) + when(self.keymanager).get_key('some@key').thenReturn(defer.succeed(OpenPGPKey('some@key'))) d = self.web.get(request) @@ -68,7 +68,7 @@ class TestKeysResource(unittest.TestCase): def test_returns_unauthorized_if_key_is_private(self): request = DummyRequest(['/keys']) request.addArg('search', 'some@key') - when(self.keymanager).fetch_key('some@key').thenReturn(defer.succeed(OpenPGPKey('some@key', private=True))) + when(self.keymanager).get_key('some@key').thenReturn(defer.succeed(OpenPGPKey('some@key', private=True))) d = self.web.get(request) diff --git a/service/test/unit/resources/test_user_settings_resource.py b/service/test/unit/resources/test_user_settings_resource.py index 42626cd5..a33ad571 100644 --- a/service/test/unit/resources/test_user_settings_resource.py +++ b/service/test/unit/resources/test_user_settings_resource.py @@ -35,7 +35,7 @@ class TestUserSettingsResource(unittest.TestCase): key = OpenPGPKey(MAIL_ADDRESS) key.fingerprint = FINGERPRINT request = DummyRequest(['/user-settings']) - when(self.keymanager).fetch_key(MAIL_ADDRESS).thenReturn(defer.succeed(key)) + when(self.keymanager).get_key(MAIL_ADDRESS).thenReturn(defer.succeed(key)) d = self.web.get(request) @@ -51,7 +51,7 @@ class TestUserSettingsResource(unittest.TestCase): key = OpenPGPKey(MAIL_ADDRESS) key.fingerprint = FINGERPRINT request = DummyRequest(['/user-settings']) - when(self.keymanager).fetch_key(MAIL_ADDRESS).thenReturn(defer.fail(Failure)) + when(self.keymanager).get_key(MAIL_ADDRESS).thenReturn(defer.fail(Failure)) d = self.web.get(request) |