summaryrefslogtreecommitdiff
path: root/src/leap/eip/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/eip/tests')
-rw-r--r--src/leap/eip/tests/test_config.py6
-rw-r--r--src/leap/eip/tests/test_eipconnection.py19
2 files changed, 23 insertions, 2 deletions
diff --git a/src/leap/eip/tests/test_config.py b/src/leap/eip/tests/test_config.py
index b6b06346..ed9fe270 100644
--- a/src/leap/eip/tests/test_config.py
+++ b/src/leap/eip/tests/test_config.py
@@ -7,8 +7,9 @@ try:
except ImportError:
import unittest
-from leap.testing.basetest import BaseLeapTest
+from leap.base import constants
from leap.eip import config as eip_config
+from leap.testing.basetest import BaseLeapTest
_system = platform.system()
@@ -62,7 +63,8 @@ class EIPConfigTest(BaseLeapTest):
args.append('unix')
args.append('--config')
args.append(os.path.expanduser(
- '~/.config/leap/providers/default/openvpn.conf'))
+ '~/.config/leap/providers/%s/openvpn.conf'
+ % constants.DEFAULT_TEST_PROVIDER))
return args
# build command string
diff --git a/src/leap/eip/tests/test_eipconnection.py b/src/leap/eip/tests/test_eipconnection.py
index 51772b7c..dee28935 100644
--- a/src/leap/eip/tests/test_eipconnection.py
+++ b/src/leap/eip/tests/test_eipconnection.py
@@ -1,6 +1,7 @@
import ConfigParser
import logging
import platform
+import os
logging.basicConfig()
logger = logging.getLogger(name=__name__)
@@ -12,6 +13,7 @@ except ImportError:
from mock import Mock, patch # MagicMock
+from leap.base import constants
from leap.eip.eipconnection import EIPConnection
from leap.eip.exceptions import ConnectionRefusedError
@@ -59,6 +61,10 @@ class EIPConductorTest(unittest.TestCase):
"for the running platform: %s" %
_system)
+ def touch(self, filepath):
+ with open(filepath, 'w') as fp:
+ fp.write('')
+
#
# tests
#
@@ -75,6 +81,19 @@ class EIPConductorTest(unittest.TestCase):
"""
default attrs as expected
"""
+ # XXX there's a conceptual/design
+ # mistake here.
+ # If we're testing just attrs after init,
+ # init shold not be doing so much side effects.
+
+ # for instance:
+ # We have to TOUCH a keys file because
+ # we're triggerig the key checks FROM
+ # the constructo. me not like that,
+ # key checker should better be called explicitelly.
+ self.touch(os.path.expanduser(
+ '~/.config/leap/providers/%s/openvpn.keys'
+ % constants.DEFAULT_TEST_PROVIDER))
con = self.con
self.assertEqual(con.autostart, True)
self.assertEqual(con.missing_pkexec, False)