Skip to content
Snippets Groups Projects
Commit da5bea8c authored by Sebastian Mohr's avatar Sebastian Mohr
Browse files

python 3.9 has no match afaik

parent 7746ecd1
Branches
No related tags found
No related merge requests found
Pipeline #510592 failed
......@@ -60,7 +60,6 @@ def get_metadata(token: Token) -> TokenMetadata:
f"{token.deployment_url}/api/token-meta",
json={"token": token.token, "book_id": token.book_id},
)
print(res.headers)
res = parse_response(res)
# Check if the request was successful
......@@ -72,7 +71,6 @@ def get_metadata(token: Token) -> TokenMetadata:
res["_original_response"].raise_for_status()
# Parse the response
print(res)
data = res["data"]
if data is None:
raise ValueError("No data returned from the API.")
......
......@@ -37,11 +37,10 @@ class TestRequest(ABC, Generic[T]):
if "exc" in overwrites:
kwargs = {"exc": overwrites["exc"]}
match self.type:
case "GET":
requests_mock.get(self.url, **kwargs)
case "POST":
requests_mock.post(self.url, **kwargs)
if self.type == "GET":
requests_mock.get(self.url, **kwargs)
elif self.type == "POST":
requests_mock.post(self.url, **kwargs)
def test_connection_timeout(self, requests_mock):
self.mock_responses(requests_mock, exc=requests.exceptions.ConnectTimeout)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment