From 105728c2ab072217dc16c3611e79b388aaab44a7 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Tue, 20 Feb 2024 09:00:56 -0500 Subject: [PATCH] Tests: Support jsonschema 4.21 This fixes unit test compatibility with jsonschema 4.21 while maintaining compat with jsonschema 3.2. Change-Id: If9b8b4ccc805c8086c180e881b0ddd712289ad13 --- cinder/tests/unit/api/test_api_validation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cinder/tests/unit/api/test_api_validation.py b/cinder/tests/unit/api/test_api_validation.py index a2c03833edd..be53427fa64 100644 --- a/cinder/tests/unit/api/test_api_validation.py +++ b/cinder/tests/unit/api/test_api_validation.py @@ -303,8 +303,10 @@ class StringLengthTestCase(APIValidationTestCase): req=FakeRequest())) def test_validate_string_length_fails(self): + # checks for jsonschema output from 3.2.x and 4.21.x detail = ("Invalid input for field/attribute foo. Value: ." - " '' is too short") + " '' " + "(is too short|should be non-empty)") self.check_validation_error(self.post, body={'foo': ''}, expected_detail=detail)