From 2db713346d656c3486228678ad020b56440c1e34 Mon Sep 17 00:00:00 2001 From: James Falcon Date: Fri, 22 Oct 2021 22:06:51 -0500 Subject: Remove pin in dependencies for jsonschema (#1078) In jsonschema 4, hostname validation was changed to have an optional dependency on the fqdn package. Since we don't have this dependency in cloud-init, attempting this validation will no longer fail for a string that isn't a valid hostname. --- tests/unittests/test_handler/test_schema.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') 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)) -- cgit v1.2.3