diff options
author | antialias <antialias@leap.se> | 2012-08-21 13:46:01 -0700 |
---|---|---|
committer | antialias <antialias@leap.se> | 2012-08-21 13:46:01 -0700 |
commit | 6ce22c7ebd293550473bfa5453a2f720dffad3e8 (patch) | |
tree | f4c19d1bbea969aa6b3279ad038db1d486e5eaf0 /src/leap | |
parent | af33eaa36c3b799a14a56b7845db3833ed52b97d (diff) |
minor pep8 clean up.
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/eip/config.py | 8 | ||||
-rw-r--r-- | src/leap/eip/exceptions.py | 2 | ||||
-rw-r--r-- | src/leap/eip/tests/tests_config.py | 7 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/leap/eip/config.py b/src/leap/eip/config.py index a219fedb..e0151e87 100644 --- a/src/leap/eip/config.py +++ b/src/leap/eip/config.py @@ -403,14 +403,14 @@ def check_vpn_keys(config): check_and_fix_urw_only(keyfile) except OSError: raise EIPInitBadKeyFilePermError - - + + def get_config_json(config_file=None): """ will replace get_config function be developing them in parralel for branch purposes. @param: configuration file - @type: file + @type: file @rparam: configuration turples @rtype: dictionary """ @@ -421,7 +421,7 @@ def get_config_json(config_file=None): if not os.path.isdir(dpath): mkdir_p(dpath) with open(fpath, 'wb') as configfile: - configfile.write() + configfile.flush() config_file = open(fpath) config = json.load(config_file) diff --git a/src/leap/eip/exceptions.py b/src/leap/eip/exceptions.py index ac61f42b..3719c605 100644 --- a/src/leap/eip/exceptions.py +++ b/src/leap/eip/exceptions.py @@ -61,5 +61,3 @@ class EIPInitNoKeyFileError(Exception): class EIPInitBadKeyFilePermError(Exception): pass - - diff --git a/src/leap/eip/tests/tests_config.py b/src/leap/eip/tests/tests_config.py index 6534723e..5a0e2d94 100644 --- a/src/leap/eip/tests/tests_config.py +++ b/src/leap/eip/tests/tests_config.py @@ -5,14 +5,15 @@ import unittest from leap.eip import config + class TestConfig(unittest.TestCase): """ Test configuration help functions. """ + def test_get_config_json(self): config_js = config.get_config_json() self.assertTrue(isinstance(config_js, dict)) - self.assertTrue(config_js.has_key('transport')) - self.assertTrue(config_js.has_key('provider')) + self.assertTrue('transport' in config_js) + self.assertTrue('provider' in config_js) self.assertEqual(config_js['provider'], "testprovider.org") - |