Skip to content

Commit

Permalink
Regression test for #65
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Feb 3, 2021
1 parent 927fbf8 commit 0f933d3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_canonicalise.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,3 +558,19 @@ def test_validators_use_proper_draft():
}
cc = canonicalish(schema)
jsonschema.validators.validator_for(cc).check_schema(cc)


def test_reference_resolver_issue_65_regression():
schema = {
"allOf": [{"$ref": "#/definitions/ref"}, {"required": ["foo"]}],
"properties": {"foo": {}},
"definitions": {"ref": {"maxProperties": 1}},
"type": "object",
}
res = resolve_all_refs(schema)
can = canonicalish(res)
assert "$ref" not in res
assert "$ref" not in can
for s in (schema, res, can):
with pytest.raises(jsonschema.ValidationError):
jsonschema.validate({}, s)

0 comments on commit 0f933d3

Please sign in to comment.