Skip to content

Commit

Permalink
Add test demonstrating function behavior with invalid collection name
Browse files Browse the repository at this point in the history
  • Loading branch information
eecavanna committed Dec 12, 2024
1 parent ae83dc9 commit 7358d8b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_util/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ def test_validate_json():
result = validate_json(in_docs=database_dict, mdb=mdb)
assert result == ok_result

# Test: The function reports an error for a schema-defiant collection name.
database_dict = {"OTHER_set": []}
result = validate_json(in_docs=database_dict, mdb=mdb)
assert result["result"] == "errors"
assert "OTHER_set" in result["detail"]
assert len(result["detail"]["OTHER_set"]) == 1

# Test: Two empty collections is valid.
database_dict = {"biosample_set": [], "study_set": []}
result = validate_json(in_docs=database_dict, mdb=mdb)
Expand Down

0 comments on commit 7358d8b

Please sign in to comment.