Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
adnejacobsen committed Sep 7, 2023
1 parent c068b59 commit 94014ec
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/test_schema/test_schema_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,22 +348,23 @@ def test_schema_logic_classification(schema_080, metadata_examples):
with pytest.raises(jsonschema.exceptions.ValidationError):
jsonschema.validate(instance=example, schema=schema_080)


def test_schema_logic_data_spec(schema_080, metadata_examples):
"""Test schema logic for data.spec"""

# fetch surface example
example_surface = deepcopy(metadata_examples["surface_depth.yml"])

# assert validation with no changes
jsonschema.validate(instance=example_surface, schema=schema_080)

# assert data.spec required when class == surface
del example_surface["data"]["spec"]
with pytest.raises(jsonschema.exceptions.ValidationError):
jsonschema.validate(instance=example_surface, schema=schema_080)

# fetch dictionary example
example_dict = deepcopy(metadata_examples["dictionary_parameters.yml"])

# assert data.spec not required when class === dictionary
jsonschema.validate(instance=example_dict, schema=schema_080)
jsonschema.validate(instance=example_dict, schema=schema_080)

0 comments on commit 94014ec

Please sign in to comment.