Skip to content

Commit

Permalink
bad network type test
Browse files Browse the repository at this point in the history
  • Loading branch information
colltoaction committed Aug 21, 2024
1 parent 53a8a93 commit c4d8b6f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ def bad_top_level_field():
return json.load(open(f"{json_dir}/bad_top_level_field.json", "r"))


@pytest.fixture
def bad_network_type():
return json.load(open(f"{json_dir}/bad_network_type.json", "r"))


@pytest.fixture
def metadata_as_list():
return json.load(open(f"{json_dir}/metadata_as_list.json", "r"))
Expand Down
1 change: 1 addition & 0 deletions tests/test_files/bad_network_type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"network-type": "badnt", "incidences": []}
5 changes: 5 additions & 0 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ def test_bad_top_level_field(validator, bad_top_level_field):
validator(bad_top_level_field)


def test_bad_network_type(validator, bad_network_type):
with pytest.raises(ValueError):
validator(bad_network_type)


def test_metadata_as_list(validator, metadata_as_list):
with pytest.raises(ValueError):
validator(metadata_as_list)
Expand Down

0 comments on commit c4d8b6f

Please sign in to comment.