Skip to content

Commit dee722d

Browse files
committed
fix: Solve failing ted api tests with response status
1 parent 50c5e49 commit dee722d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

tests/e2e/notice_fetcher/test_ted_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def test_ted_api():
2727

2828
def test_ted_api_error():
2929
ted = TedAPIAdapter(request_api=TedRequestAPI())
30+
response_status = "400"
3031
with pytest.raises(Exception) as e:
3132
ted.get_by_query(query={"query": "NDE=67623-2022"})
32-
assert str(e.value) == "The TED-API call failed with: <Response [400]>"
33+
assert response_status in str(e.value)

tests/e2e/notice_fetcher/test_ted_request_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def test_ted_request_api():
1515
notice_by_query = ted_api_request(api_url=config.TED_API_URL, api_query=api_query)
1616
assert notice_by_query
1717
assert isinstance(notice_by_query, dict)
18+
response_code = "400"
1819
with pytest.raises(Exception) as e:
1920
ted_api_request(api_url=config.TED_API_URL, api_query={"query": "INCORRECT PARAMS"})
20-
assert str(e.value) == "The TED-API call failed with: <Response [400]>"
21+
assert response_code in str(e.value)

0 commit comments

Comments
 (0)