diff --git a/tests/conftest.py b/tests/conftest.py index aab6300..44e6ab5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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")) diff --git a/tests/test_files/bad_network_type.json b/tests/test_files/bad_network_type.json new file mode 100644 index 0000000..3a38dc7 --- /dev/null +++ b/tests/test_files/bad_network_type.json @@ -0,0 +1 @@ +{"network-type": "badnt", "incidences": []} \ No newline at end of file diff --git a/tests/test_schema.py b/tests/test_schema.py index 04017e3..fb9f219 100644 --- a/tests/test_schema.py +++ b/tests/test_schema.py @@ -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)