Compare commits

...

2 Commits

Author SHA1 Message Date
vikynoah
2d6de99585 fix: post_file method change for testing (#29)
* fix: post_file method change for testing

* changes
2025-01-16 09:35:23 +01:00
vikynoah
573f59349f fix: changes to post method in testing_async (#28) 2025-01-08 19:37:10 +01:00
2 changed files with 5 additions and 3 deletions

View File

@@ -41,7 +41,7 @@ class GenericClient(TestClient):
re = self.c.post(
url,
files={"file": file},
headers=self.default_headers | {"Content-Type": "application/json"},
headers=self.default_headers,
*args,
**kwargs,
)

View File

@@ -1,4 +1,5 @@
import json
from httpx import ASGITransport, AsyncClient
@@ -35,7 +36,8 @@ class AsyncGenericClient:
)
if re.status_code != r_code:
print(re.content)
assert r_code == re.status_code
if not raw_response:
assert r_code == re.status_code
return re.json() if not raw_response else re
async def post_file(
@@ -44,7 +46,7 @@ class AsyncGenericClient:
re = await self.c.post(
url,
files={"file": file},
headers=self.default_headers | {"Content-Type": "application/json"},
headers=self.default_headers,
*args,
**kwargs,
)