]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/commitdiff
Add test to check error message.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Fri, 29 Oct 2021 07:15:00 +0000 (09:15 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Fri, 29 Oct 2021 07:18:55 +0000 (09:18 +0200)
tests/test_json_validate.py

index a98af6d70203243ca595520134dad9c7ccd4ee24..e8e8766357a7d4c0f9bd578ff322e40b56341417 100644 (file)
@@ -171,8 +171,9 @@ class TestJsonValidate(unittest.TestCase):
     def test_object_nested_wrong_type(self):
         schema = deepcopy(schema_object)
         schema['properties']['nested'] = schema_object
-        with self.assertRaises(ValueError):
+        with self.assertRaises(ValueError) as cm:
             order_json_keys({'name': 'name', 'nested': {'name': True}}, schema)
+        self.assertIn("['nested']['name']", str(cm.exception))
 
     def test_array_empty(self):
         schema = schema_array