Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions jsf/tests/data/anyof_true.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"new_parent": { "type": "boolean" },
"new_subsidiary": { "type": "boolean" },
"new_sibling": { "type": "boolean" }
},
"additionalProperties": false,
"anyOf": [
{ "properties": { "new_parent": { "const": true } } },
{ "properties": { "new_subsidiary": { "const": true } } },
{ "properties": { "new_sibling": { "const": true } } }
]
}
15 changes: 0 additions & 15 deletions jsf/tests/data/min-required-props-oneof.json

This file was deleted.

6 changes: 3 additions & 3 deletions jsf/tests/test_default_fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,8 @@ def test_use_defaults_and_examples(TestData):
assert breed is None or breed == "Mixed Breed"


def test_min_required_props_oneof(TestData):
with open(TestData / "min-required-props-oneof.json") as file:
def test_anyof_true(TestData):
with open(TestData / "anyof_true.json") as file:
schema = json.load(file)
p = JSF(schema)
fake_data = [p.generate(use_examples=True) for _ in range(100)]
Expand All @@ -556,7 +556,7 @@ def test_min_required_props_oneof(TestData):
assert isinstance(d, dict)
assert len(d.keys()) >= 1
assert all(isinstance(v, bool) for v in d.values())
assert all(d.values())
assert any(d.values())


def test_bool_enum(TestData):
Expand Down