summaryrefslogtreecommitdiff
path: root/src/leap/keymanager/tests
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2014-07-29 16:09:48 -0300
committerdrebs <drebs@leap.se>2014-07-29 16:09:48 -0300
commit0c6348fc64adbbe0a2dc55eb408186ec92bbc7c4 (patch)
tree6e7119a0d160f649ad22ca5b4757da866fb1d05c /src/leap/keymanager/tests
parentbc1d3adfc408085b0fbc8f09c930a68b42e4c46a (diff)
parentb05c3f0020ab4ca4761cc1042e55cc37b007d297 (diff)
Merge branch 'bug/tests-dont-pass' into develop
Diffstat (limited to 'src/leap/keymanager/tests')
-rw-r--r--src/leap/keymanager/tests/test_keymanager.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/leap/keymanager/tests/test_keymanager.py b/src/leap/keymanager/tests/test_keymanager.py
index e2558e45..f89dcd9b 100644
--- a/src/leap/keymanager/tests/test_keymanager.py
+++ b/src/leap/keymanager/tests/test_keymanager.py
@@ -147,8 +147,8 @@ class KeyManagerWithSoledadTestCase(BaseLeapTest):
for key in km.get_all_keys_in_local_db(private=True):
km._wrapper_map[key.__class__].delete_key(key)
- def _key_manager(self, user=ADDRESS, url=''):
- return KeyManager(user, url, self._soledad,
+ def _key_manager(self, user=ADDRESS, url='', token=None):
+ return KeyManager(user, url, self._soledad, token=token,
gpgbinary=GPG_BINARY_PATH)
@@ -387,7 +387,8 @@ class KeyManagerKeyManagementTestCase(KeyManagerWithSoledadTestCase):
"""
Test that request is well formed when sending keys to server.
"""
- km = self._key_manager()
+ token = "mytoken"
+ km = self._key_manager(token=token)
km._wrapper_map[OpenPGPKey].put_ascii_key(PUBLIC_KEY)
km._fetcher.put = Mock()
# the following data will be used on the send
@@ -404,7 +405,7 @@ class KeyManagerKeyManagementTestCase(KeyManagerWithSoledadTestCase):
url = '%s/%s/users/%s.json' % ('apiuri', 'apiver', 'myuid')
km._fetcher.put.assert_called_once_with(
url, data=data, verify='capath',
- cookies={'_session_id': 'sessionid'},
+ headers={'Authorization': 'Token token=%s' % token},
)
def test__fetch_keys_from_server(self):