summaryrefslogtreecommitdiff
path: root/src/leap/eip/tests/test_config.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-02 05:31:47 +0900
committerkali <kali@leap.se>2012-10-02 05:31:47 +0900
commitb81337d8a183bffe32ebf512c49a6af07fc7622e (patch)
tree0352010716fcc0118eab6c0d6c9e5e543c8b150f /src/leap/eip/tests/test_config.py
parentf56e89199c063ea76a901ae187933c7604b4858b (diff)
parentabf481cab381a86d8a9c5607a131b56636081382 (diff)
Merge branch 'feature/json-validation' into develop
Conflicts: src/leap/eip/config.py src/leap/eip/specs.py
Diffstat (limited to 'src/leap/eip/tests/test_config.py')
-rw-r--r--src/leap/eip/tests/test_config.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/leap/eip/tests/test_config.py b/src/leap/eip/tests/test_config.py
index f9f963dc..6759b522 100644
--- a/src/leap/eip/tests/test_config.py
+++ b/src/leap/eip/tests/test_config.py
@@ -12,7 +12,7 @@ except ImportError:
#from leap.eip import config as eip_config
from leap import __branding as BRANDING
from leap.eip import config as eipconfig
-from leap.eip.tests.data import EIP_SAMPLE_SERVICE
+from leap.eip.tests.data import EIP_SAMPLE_CONFIG, EIP_SAMPLE_SERVICE
from leap.testing.basetest import BaseLeapTest
from leap.util.fileutil import mkdir_p
@@ -47,13 +47,21 @@ class EIPConfigTest(BaseLeapTest):
os.chmod(tfile, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
def write_sample_eipservice(self):
- conf = eipconfig.EIPConfig()
+ conf = eipconfig.EIPServiceConfig()
folder, f = os.path.split(conf.filename)
if not os.path.isdir(folder):
mkdir_p(folder)
with open(conf.filename, 'w') as fd:
fd.write(json.dumps(EIP_SAMPLE_SERVICE))
+ def write_sample_eipconfig(self):
+ conf = eipconfig.EIPConfig()
+ folder, f = os.path.split(conf.filename)
+ if not os.path.isdir(folder):
+ mkdir_p(folder)
+ with open(conf.filename, 'w') as fd:
+ fd.write(json.dumps(EIP_SAMPLE_CONFIG))
+
def get_expected_openvpn_args(self):
args = []
username = self.get_username()
@@ -123,6 +131,8 @@ class EIPConfigTest(BaseLeapTest):
def test_build_ovpn_command_empty_config(self):
self.touch_exec()
self.write_sample_eipservice()
+ self.write_sample_eipconfig()
+
from leap.eip import config as eipconfig
from leap.util.fileutil import which
path = os.environ['PATH']