Skip to content

Commit c92de8f

Browse files
authored
SFR-2099: Edge Case API Tests for get/collection (#436)
* SFR-2299/add_edge_cases_get_collection * remove comments * add a line
1 parent 06d63b2 commit c92de8f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/integration/api/test_get_collection.py

+21
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,24 @@ def test_get_collection():
1313
response_json = response.json()
1414

1515
assert response_json is not None
16+
17+
def test_get_collection_non_existent_id():
18+
url = API_URL + '/collection/00000000-0000-0000-0000-000000000000'
19+
response = requests.get(url)
20+
assert_response_status(url, response, 404)
21+
22+
def test_get_collection_malformed_id():
23+
url = API_URL + '/collection/invalid_id_format'
24+
response = requests.get(url)
25+
assert_response_status(url, response, 400)
26+
27+
def test_get_collection_empty_id():
28+
url = API_URL + '/collection/'
29+
response = requests.get(url)
30+
assert_response_status(url, response, 404)
31+
32+
def test_get_collection_special_characters():
33+
url = API_URL + '/collection/%$@!*'
34+
response = requests.get(url)
35+
assert_response_status(url, response, 400)
36+

0 commit comments

Comments
 (0)