From e6483d20a5500e86b5fa4e7da63f911641b7e9dd Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 30 Aug 2012 01:11:42 +0900 Subject: fix config load method it was not updating config dict --- src/leap/eip/tests/test_checks.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/leap/eip/tests') diff --git a/src/leap/eip/tests/test_checks.py b/src/leap/eip/tests/test_checks.py index e53a2a1d..5697ad10 100644 --- a/src/leap/eip/tests/test_checks.py +++ b/src/leap/eip/tests/test_checks.py @@ -93,19 +93,26 @@ class EIPCheckTest(BaseLeapTest): # This error will be possible catched in a different # place, when JSONConfig does validation of required fields. - sampleconfig = copy.copy(testdata.EIP_SAMPLE_JSON) + # passing direct config + with self.assertRaises(eipexceptions.EIPMissingDefaultProvider): + checker.check_is_there_default_provider(config={}) + + # ok. now, messing with real files... # blank out default_provider + sampleconfig = copy.copy(testdata.EIP_SAMPLE_JSON) sampleconfig['provider'] = None - eipcfg_path = checker._get_default_eipconfig_path() + eipcfg_path = checker.eipconfig.filename with open(eipcfg_path, 'w') as fp: json.dump(sampleconfig, fp) with self.assertRaises(eipexceptions.EIPMissingDefaultProvider): + checker.eipconfig.load(fromfile=eipcfg_path) checker.check_is_there_default_provider() sampleconfig = testdata.EIP_SAMPLE_JSON - eipcfg_path = checker._get_default_eipconfig_path() + #eipcfg_path = checker._get_default_eipconfig_path() with open(eipcfg_path, 'w') as fp: json.dump(sampleconfig, fp) + checker.eipconfig.load() self.assertTrue(checker.check_is_there_default_provider()) def test_fetch_definition(self): -- cgit v1.2.3