Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
dmezzogori committed Jul 24, 2023
1 parent c8a8c4e commit 0d699fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kwik/tests/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

import urllib.parse
from typing import TYPE_CHECKING, Any, Literal, Mapping, TypeVar
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, Literal, TypeVar

from fastapi.encoders import jsonable_encoder
from fastapi.testclient import TestClient
Expand Down Expand Up @@ -42,7 +43,7 @@ def get_multi_uri(self) -> str:

@property
def post_uri(self) -> str:
return self.BASE_URI
return f"{self.BASE_URI}/"

@property
def put_uri(self) -> str:
Expand Down Expand Up @@ -93,6 +94,9 @@ def get_multi(
return assert_status_code_and_return_response(self.client.get(uri, headers=self.headers))

def post(self, data: BaseModel, status_code: int = 200, post_uri: str | None = None) -> EndpointReturn:
if post_uri is None:
post_uri = self.post_uri

return assert_status_code_and_return_response(
self.client.post(f"{post_uri or self.post_uri}", json=jsonable_encoder(data), headers=self.headers),
status_code=status_code,
Expand Down
2 changes: 2 additions & 0 deletions kwik/tests/utils/tokens.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import kwik
from fastapi.testclient import TestClient

Expand Down

0 comments on commit 0d699fa

Please sign in to comment.