From 83bff4cad1e4345eb534cef28ea464b0b5a5e2fd Mon Sep 17 00:00:00 2001 From: kali Date: Wed, 10 Oct 2012 04:23:34 +0900 Subject: fix failing test on test_eipconnection Closes #738 --- src/leap/eip/eipconnection.py | 11 +++++++---- src/leap/eip/tests/test_eipconnection.py | 9 ++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src/leap/eip') 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 -- cgit v1.2.3