Skip to content

Commit 3623325

Browse files
committed
add test for json strings
1 parent 48e5ab0 commit 3623325

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

unit_tests/sources/declarative/validators/test_validate_adheres_to_schema.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,17 @@ def test_given_empty_schema_when_validate_then_succeeds(self):
114114

115115
validator = ValidateAdheresToSchema(schema=empty_schema)
116116

117-
validator.validate(123)
118-
validator.validate("string value")
119117
validator.validate({"complex": "object"})
120-
validator.validate([1, 2, 3])
121-
validator.validate(None)
122-
validator.validate(True)
118+
119+
def test_given_json_string_when_validate_then_succeeds(self):
120+
schema = {
121+
"type": "object",
122+
"properties": {
123+
"id": {"type": "integer"},
124+
"name": {"type": "string"},
125+
},
126+
}
127+
128+
validator = ValidateAdheresToSchema(schema=schema)
129+
130+
validator.validate('{"id": 1, "name": "John Doe"}')

0 commit comments

Comments
 (0)