Skip to content

Commit

Permalink
Fix a test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Feb 28, 2024
1 parent fe9347f commit 4123b3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_from_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,20 +364,22 @@ def test_cannot_generate_for_empty_test_suite_schema(name):
# merged or otherwise handled correctly, with the exception of the key "ab" which
# would have to be both an integer and a string (and is thus disallowed).
OVERLAPPING_PATTERNS_SCHEMA = {
"type": "string",
"type": "object",
"patternProperties": {
r"\A[ab]{1,2}\Z": {},
r"\Aa[ab]\Z": {"type": "integer"},
r"\A[ab]b\Z": {"type": "string"},
},
"additionalProperties": False,
"minimumProperties": 1,
"minProperties": 1,
}


@given(from_schema(OVERLAPPING_PATTERNS_SCHEMA))
def test_handles_overlapping_patternproperties(value):
jsonschema.validate(value, OVERLAPPING_PATTERNS_SCHEMA)
assert isinstance(value, dict)
assert len(value) >= 1
assert "ab" not in value


Expand Down

0 comments on commit 4123b3d

Please sign in to comment.