summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-10 04:23:34 +0900
committerkali <kali@leap.se>2012-10-10 04:23:34 +0900
commit83bff4cad1e4345eb534cef28ea464b0b5a5e2fd (patch)
treea69faf733244797c9fc180da6bfe17480e931b0f
parentf043f9087232a416bf9fa7dbb0b8f9b6f4e0a04e (diff)
fix failing test on test_eipconnection
Closes #738
-rw-r--r--src/leap/eip/eipconnection.py11
-rw-r--r--src/leap/eip/tests/test_eipconnection.py9
2 files changed, 15 insertions, 5 deletions
diff --git a/src/leap/eip/eipconnection.py b/src/leap/eip/eipconnection.py
index a5b59892..2750d641 100644
--- a/src/leap/eip/eipconnection.py
+++ b/src/leap/eip/eipconnection.py
@@ -54,6 +54,7 @@ class EIPConnection(OpenVPNConnection):
run all eip checks previous to attempting a connection
"""
logger.debug('running conductor checks')
+ print 'conductor checks!'
def push_err(exc):
# keep the original traceback!
@@ -62,14 +63,16 @@ class EIPConnection(OpenVPNConnection):
try:
# network (1)
- for signal in self.checker_signals:
- signal('checking encryption keys')
+ if self.checker_signals:
+ for signal in self.checker_signals:
+ signal('checking encryption keys')
self.provider_cert_checker.run_all(skip_verify=skip_verify)
except Exception as exc:
push_err(exc)
try:
- for signal in self.checker_signals:
- signal('checking provider config')
+ if self.checker_signals:
+ for signal in self.checker_signals:
+ signal('checking provider config')
self.config_checker.run_all(skip_download=skip_download)
except Exception as exc:
push_err(exc)
diff --git a/src/leap/eip/tests/test_eipconnection.py b/src/leap/eip/tests/test_eipconnection.py
index ce9d39e2..bb643ae0 100644
--- a/src/leap/eip/tests/test_eipconnection.py
+++ b/src/leap/eip/tests/test_eipconnection.py
@@ -89,12 +89,19 @@ class EIPConductorTest(BaseLeapTest):
# config checks
def test_config_checked_called(self):
+ # XXX this single test is taking half of the time
+ # needed to run tests. (roughly 3 secs for this only)
+ # We should modularize and inject Mocks on more places.
+
del(self.con)
config_checker = Mock()
self.con = MockedEIPConnection(config_checker=config_checker)
self.assertTrue(config_checker.called)
self.con.run_checks()
- self.con.config_checker.run_all.assert_called_with(skip_download=False)
+ self.con.config_checker.run_all.assert_called_with(
+ skip_download=False)
+
+ # XXX test for cert_checker also
# connect/disconnect calls