From a33fcd78efc6ae16492f3202ae7b6f536dc4b7a7 Mon Sep 17 00:00:00 2001 From: "ting.wang" Date: Sat, 6 Feb 2016 10:51:10 +0800 Subject: [PATCH] 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 --- barbican/tests/common/test_validators.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/barbican/tests/common/test_validators.py b/barbican/tests/common/test_validators.py index 725114867..56862cd77 100644 --- a/barbican/tests/common/test_validators.py +++ b/barbican/tests/common/test_validators.py @@ -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'] = ''