Skip to content

Commit

Permalink
black :/
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniell Wallis committed Jan 5, 2024
1 parent 4ce6281 commit a4e9a82
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,25 +162,28 @@ def test_property_count(self):
assert stats

def test_types(self):
'''
"""
Every property in a schema should have a type defined
'''
"""
errs = []
for schema_name in SCHEMA_FILES:
with open(os.path.join(SCHEMAS_DIR, schema_name)) as json_schema:
schema = json.load(json_schema)

if schema_name != "common.json":
for prop, fields in schema['properties'].items():
for prop, fields in schema["properties"].items():
if "type" not in fields and "$ref" not in fields:
errs.append((schema_name, prop))
else:
if "type" not in fields:
errs.append((schema_name, prop))
assert not errs, (
"The following schemata do not have types defined:\n\t"
+ "\n\t".join("- {} schema has property '{}' missing a 'type'".format(e[0], e[1]) for e in errs)
)
assert (
not errs
), "The following schemata do not have types defined:\n\t" + "\n\t".join(
"- {} schema has property '{}' missing a 'type'".format(e[0], e[1])
for e in errs
)


class TestExamples:
with open(os.path.join(SCHEMAS_DIR, "example.json")) as ff:
Expand Down

0 comments on commit a4e9a82

Please sign in to comment.