diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-08-06 17:20:54 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-08-06 17:20:54 -0300 |
commit | 8f57fbc04d2fa224a5a3fb4560da7ef9b91c202c (patch) | |
tree | 02dce93d0072287e01cb73d6d4fce1680c68be94 /src/leap/services/eip/tests | |
parent | d6bf9b3e11ff87488a5f508acebf8f20ad026166 (diff) | |
parent | d5ea34c797e56b05fc54a186cf6c998e036f4ed0 (diff) |
Merge remote-tracking branch 'ivan/feature/3310_add-support-for-multiple-schemas' into develop
Diffstat (limited to 'src/leap/services/eip/tests')
-rw-r--r-- | src/leap/services/eip/tests/test_eipconfig.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/leap/services/eip/tests/test_eipconfig.py b/src/leap/services/eip/tests/test_eipconfig.py index 8b746b78..87ce04c2 100644 --- a/src/leap/services/eip/tests/test_eipconfig.py +++ b/src/leap/services/eip/tests/test_eipconfig.py @@ -117,18 +117,21 @@ class EIPConfigTest(BaseLeapTest): conf.write(json.dumps(data)) conf.close() - def _get_eipconfig(self, fromfile=True, data=sample_config): + def _get_eipconfig(self, fromfile=True, data=sample_config, api_ver='1'): """ Helper that returns an EIPConfig object using the data parameter or a sample data. :param fromfile: sets if we should use a file or a string - :fromfile type: bool + :type fromfile: bool :param data: sets the data to be used to load in the EIPConfig object - :data type: dict (valid json) + :type data: dict (valid json) + :param api_ver: the api_version schema to use. + :type api_ver: str :rtype: EIPConfig """ config = EIPConfig() + config.set_api_version(api_ver) loaded = False if fromfile: @@ -308,6 +311,14 @@ class EIPConfigTest(BaseLeapTest): with self.assertRaises(AssertionError): config.get_client_cert_path(provider_config) + def test_fails_without_api_set(self): + config = EIPConfig() + with self.assertRaises(AssertionError): + config.load('non-relevant-path') + + def test_fails_with_api_without_schema(self): + with self.assertRaises(AssertionError): + self._get_eipconfig(api_ver='123') if __name__ == "__main__": unittest.main() |