Active a unit test in comon/test_validators
In a word, the reason why type is None is that JSONSchema checker doesn't return the unified form when the outmost layer of JSONSchema doesn't pass the examination. So, we can use assertIn instead. Change-Id: I49a2879ce249d83ee7ab36f1e0a67fe887aa4738 Closes-bug: #1531841
This commit is contained in:
committed by
ChangBo Guo(gcb)
parent
ce5b1f151f
commit
a33fcd78ef
@@ -664,14 +664,13 @@ class WhenTestingContainerValidator(utils.BaseTestCase):
|
||||
def test_should_raise_no_type(self):
|
||||
del self.container_req['type']
|
||||
|
||||
self.assertRaises(
|
||||
exception = self.assertRaises(
|
||||
excep.InvalidObject,
|
||||
self.validator.validate,
|
||||
self.container_req,
|
||||
)
|
||||
|
||||
# TODO(hgedikli): figure out why invalid_property is null here
|
||||
# self.assertEqual('type', e.exception.invalid_property)
|
||||
self.assertIn('type', exception.message)
|
||||
|
||||
def test_should_raise_empty_type(self):
|
||||
self.container_req['type'] = ''
|
||||
|
||||
Reference in New Issue
Block a user