diff options
Diffstat (limited to 'src/leap/base/tests/test_validation.py')
-rw-r--r-- | src/leap/base/tests/test_validation.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/leap/base/tests/test_validation.py b/src/leap/base/tests/test_validation.py index 87e99648..b45fbe3a 100644 --- a/src/leap/base/tests/test_validation.py +++ b/src/leap/base/tests/test_validation.py @@ -1,5 +1,6 @@ import copy import datetime +from functools import partial #import json try: import unittest2 as unittest @@ -7,8 +8,6 @@ except ImportError: import unittest import os -import jsonschema - from leap.base.config import JSONLeapConfig from leap.base import pluggableconfig from leap.testing.basetest import BaseLeapTest @@ -76,16 +75,18 @@ class TestJSONLeapConfigValidation(BaseLeapTest): def test_broken_int(self): _config = copy.deepcopy(SAMPLE_CONFIG_DICT) _config['prop_one'] = '1' - with self.assertRaises(jsonschema.ValidationError): - self.sampleconfig.validate(_config) + self.assertRaises( + pluggableconfig.ValidationError, + partial(self.sampleconfig.validate, _config)) def test_format_property(self): # JsonSchema Validator does not check the format property. # We should have to extend the Configuration class blah = copy.deepcopy(SAMPLE_CONFIG_DICT) blah['prop_uri'] = 'xxx' - with self.assertRaises(pluggableconfig.TypeCastException): - self.sampleconfig.validate(blah) + self.assertRaises( + pluggableconfig.TypeCastException, + partial(self.sampleconfig.validate, blah)) if __name__ == "__main__": |