diff options
author | kali <kali@leap.se> | 2012-08-28 23:36:39 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-08-29 03:25:46 +0900 |
commit | 7a8f4db1a4743582c34a52ab448eece0e7689bc8 (patch) | |
tree | 19cb1b95d6cf1e7fe3fecd4027f472bc7faa7715 /src/leap/eip/tests/test_eipconnection.py | |
parent | 06883461f2daa616b2e3c842f53d9422703cd9c7 (diff) |
test for eip_config_checker called from eip_connection run_checks method
also:
- changed name EIPChecker -> EipConfigChecker
- Added class documentation
Diffstat (limited to 'src/leap/eip/tests/test_eipconnection.py')
-rw-r--r-- | src/leap/eip/tests/test_eipconnection.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/leap/eip/tests/test_eipconnection.py b/src/leap/eip/tests/test_eipconnection.py index 7d8acad6..26f6529e 100644 --- a/src/leap/eip/tests/test_eipconnection.py +++ b/src/leap/eip/tests/test_eipconnection.py @@ -50,8 +50,12 @@ class EIPConductorTest(BaseLeapTest): # for instance: # We have to TOUCH a keys file because # we're triggerig the key checks FROM - # the constructo. me not like that, + # the constructor. me not like that, # key checker should better be called explicitelly. + + # XXX change to keys_checker invocation + # (see config_checker) + filepath = os.path.expanduser( '~/.config/leap/providers/%s/openvpn.keys' % constants.DEFAULT_TEST_PROVIDER) @@ -60,12 +64,8 @@ class EIPConductorTest(BaseLeapTest): # we init the manager with only # some methods mocked - - self.manager = Mock( - name="openvpnmanager_mock") - + self.manager = Mock(name="openvpnmanager_mock") self.con = MockedEIPConnection() - #manager=self.manager) def tearDown(self): del self.con @@ -74,14 +74,6 @@ class EIPConductorTest(BaseLeapTest): # tests # - @unittest.skip - #ain't manager anymore! - def test_manager_was_initialized(self): - """ - manager init ok during conductor init? - """ - self.manager.assert_called_once_with() - def test_vpnconnection_defaults(self): """ default attrs as expected @@ -109,6 +101,16 @@ class EIPConductorTest(BaseLeapTest): self.assertEqual(self.con.args, [1, 2, 3]) + # config checks + + def test_config_checked_called(self): + 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) + # connect/disconnect calls def test_disconnect(self): |