Skip to content

Commit

Permalink
Add test for attempt to set coll access to invalid value
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Nov 22, 2024
1 parent deea447 commit 4919724
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions backend/test/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,24 @@ def test_collection_public(crawler_auth_headers, default_org_id):
assert r.status_code == 404


def test_collection_access_invalid_value(crawler_auth_headers, default_org_id):
r = requests.patch(
f"{API_PREFIX}/orgs/{default_org_id}/collections/{_coll_id}",
headers=crawler_auth_headers,
json={
"access": "invalid",
},
)
assert r.status_code == 400

r = requests.get(
f"{API_PREFIX}/orgs/{default_org_id}/collections/{_coll_id}",
headers=crawler_auth_headers,
)
assert r.status_code == 200
assert r.json()["access"] == "private"


def test_add_upload_to_collection(crawler_auth_headers, default_org_id):
with open(os.path.join(curr_dir, "data", "example.wacz"), "rb") as fh:
r = requests.put(
Expand Down

0 comments on commit 4919724

Please sign in to comment.