diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unittests/test_handler/test_schema.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/unittests/test_handler/test_schema.py b/tests/unittests/test_handler/test_schema.py index 6b0b1f74..6f37ceb7 100644 --- a/tests/unittests/test_handler/test_schema.py +++ b/tests/unittests/test_handler/test_schema.py @@ -108,11 +108,11 @@ class ValidateCloudConfigSchemaTest(CiTestCase): def test_validateconfig_schema_honors_formats(self): """With strict True, validate_cloudconfig_schema errors on format.""" schema = { - 'properties': {'p1': {'type': 'string', 'format': 'hostname'}}} + 'properties': {'p1': {'type': 'string', 'format': 'email'}}} with self.assertRaises(SchemaValidationError) as context_mgr: validate_cloudconfig_schema({'p1': '-1'}, schema, strict=True) self.assertEqual( - "Cloud config schema errors: p1: '-1' is not a 'hostname'", + "Cloud config schema errors: p1: '-1' is not a 'email'", str(context_mgr.exception)) @@ -189,12 +189,12 @@ class ValidateCloudConfigFileTest(CiTestCase): def test_validateconfig_file_sctrictly_validates_schema(self): """validate_cloudconfig_file raises errors on invalid schema.""" schema = { - 'properties': {'p1': {'type': 'string', 'format': 'hostname'}}} - write_file(self.config_file, '#cloud-config\np1: "-1"') + 'properties': {'p1': {'type': 'string', 'format': 'string'}}} + write_file(self.config_file, '#cloud-config\np1: -1') with self.assertRaises(SchemaValidationError) as context_mgr: validate_cloudconfig_file(self.config_file, schema) self.assertEqual( - "Cloud config schema errors: p1: '-1' is not a 'hostname'", + "Cloud config schema errors: p1: -1 is not of type 'string'", str(context_mgr.exception)) |