summaryrefslogtreecommitdiff
path: root/keymanager/src/leap
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-09-24 14:04:43 +0200
committerKali Kaneko <kali@leap.se>2015-09-24 12:09:49 -0400
commit44c30bb893ad36673915243a96c1e3ae709dab82 (patch)
tree40f55fc39b8f61cf8fe2caec5269ea3f127048f1 /keymanager/src/leap
parentff85233fdf560c344a473b72b41d9cf078cddba3 (diff)
[style] fix pep8 warnings
Diffstat (limited to 'keymanager/src/leap')
-rw-r--r--keymanager/src/leap/keymanager/__init__.py7
-rw-r--r--keymanager/src/leap/keymanager/tests/test_keymanager.py5
2 files changed, 8 insertions, 4 deletions
diff --git a/keymanager/src/leap/keymanager/__init__.py b/keymanager/src/leap/keymanager/__init__.py
index f00e049a..01f3b6eb 100644
--- a/keymanager/src/leap/keymanager/__init__.py
+++ b/keymanager/src/leap/keymanager/__init__.py
@@ -22,7 +22,9 @@ import fileinput
import os
import sys
import tempfile
+
from leap.common import ca_bundle
+
from ._version import get_versions
try:
@@ -146,7 +148,8 @@ class KeyManager(object):
def __del__(self):
try:
- created_tmp_combined_ca_bundle = self._combined_ca_bundle not in [ca_bundle.where(), self._ca_cert_path]
+ created_tmp_combined_ca_bundle = self._combined_ca_bundle not in \
+ [ca_bundle.where(), self._ca_cert_path]
if created_tmp_combined_ca_bundle:
os.remove(self._combined_ca_bundle)
except OSError:
@@ -164,7 +167,7 @@ class KeyManager(object):
elif not self._ca_cert_path:
return leap_ca_bundle
- tmp_file = tempfile.NamedTemporaryFile(delete=False) # delete when keymanager expires
+ tmp_file = tempfile.NamedTemporaryFile(delete=False)
with open(tmp_file.name, 'w') as fout:
fin = fileinput.input(files=(leap_ca_bundle, self._ca_cert_path))
diff --git a/keymanager/src/leap/keymanager/tests/test_keymanager.py b/keymanager/src/leap/keymanager/tests/test_keymanager.py
index b2722b2e..8d4c5dad 100644
--- a/keymanager/src/leap/keymanager/tests/test_keymanager.py
+++ b/keymanager/src/leap/keymanager/tests/test_keymanager.py
@@ -357,7 +357,7 @@ class KeyManagerKeyManagementTestCase(KeyManagerWithSoledadTestCase):
verify=ca_bundle.where())
@inlineCallbacks
- def test_fetch_key_uses_default_ca_bundle_if_also_set_as_ca_cert_path(self):
+ def test_fetch_key_use_default_ca_bundle_if_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)
@@ -369,7 +369,8 @@ class KeyManagerKeyManagementTestCase(KeyManagerWithSoledadTestCase):
@inlineCallbacks
def test_fetch_uses_combined_ca_bundle_otherwise(self):
- with tempfile.NamedTemporaryFile() as tmp_input, tempfile.NamedTemporaryFile(delete=False) as tmp_output:
+ with tempfile.NamedTemporaryFile() as tmp_input, \
+ tempfile.NamedTemporaryFile(delete=False) as tmp_output:
ca_content = 'some\ncontent\n'
ca_cert_path = tmp_input.name
self._dump_to_file(ca_cert_path, ca_content)