Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
katybaulch committed Jan 2, 2025
1 parent 89f7e91 commit bea964e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/integration_tests/corpus_type/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_get_all_corpus_types(
assert len(data) == EXPECTED_NUM_CORPORA
for item in data:
assert isinstance(item, dict)
assert all(key in ["name", "description", "valid_metadata"] for key in item)
assert all(key in ["name", "description", "metadata"] for key in item)

# Check Laws and Policies content.
laws_and_policies_ct = data[0]
Expand All @@ -35,7 +35,7 @@ def test_get_all_corpus_types(
laws_and_policies_ct["description"]
== EXPECTED_CCLW_CORPUS["corpus_type_description"]
)
assert laws_and_policies_ct["valid_metadata"] is not None
assert laws_and_policies_ct["metadata"] is not None
assert isinstance(laws_and_policies_ct["valid_metadata"], dict)

# Check Intl. Agreements content.
Expand All @@ -46,7 +46,7 @@ def test_get_all_corpus_types(
== EXPECTED_UNFCCC_CORPUS["corpus_type_description"]
)

assert int_agreements_ct["valid_metadata"] is not None
assert int_agreements_ct["metadata"] is not None
assert isinstance(int_agreements_ct["valid_metadata"], dict)


Expand All @@ -60,7 +60,7 @@ def test_get_all_corpus_types_non_super(
)
assert response.status_code == status.HTTP_403_FORBIDDEN
data = response.json()
assert data["detail"] == "User [email protected] is not authorised to READ a CORPUS TYPE"
assert data["detail"] == "User [email protected] is not authorised to READ a CORPUS_TYPE"


def test_get_all_corpus_types_when_not_authenticated(
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_tests/corpus_type/test_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def test_get_corpus_type(

assert data["name"] == expected_corpus_type["corpus_type_name"]
assert data["description"] == expected_corpus_type["corpus_type_description"]
assert data["valid_metadata"] is not None
assert isinstance(data["valid_metadata"], dict)
assert data["metadata"] is not None
assert isinstance(data["metadata"], dict)


def test_get_corpus_type_non_super(
Expand Down

0 comments on commit bea964e

Please sign in to comment.