mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-13 20:00:30 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| abe84bcfcb | |||
|
|
2d6de99585 | ||
|
|
573f59349f |
@@ -41,7 +41,7 @@ class GenericClient(TestClient):
|
|||||||
re = self.c.post(
|
re = self.c.post(
|
||||||
url,
|
url,
|
||||||
files={"file": file},
|
files={"file": file},
|
||||||
headers=self.default_headers | {"Content-Type": "application/json"},
|
headers=self.default_headers,
|
||||||
*args,
|
*args,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from httpx import ASGITransport, AsyncClient
|
from httpx import ASGITransport, AsyncClient
|
||||||
|
|
||||||
|
|
||||||
@@ -35,7 +36,8 @@ class AsyncGenericClient:
|
|||||||
)
|
)
|
||||||
if re.status_code != r_code:
|
if re.status_code != r_code:
|
||||||
print(re.content)
|
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
|
return re.json() if not raw_response else re
|
||||||
|
|
||||||
async def post_file(
|
async def post_file(
|
||||||
@@ -44,7 +46,7 @@ class AsyncGenericClient:
|
|||||||
re = await self.c.post(
|
re = await self.c.post(
|
||||||
url,
|
url,
|
||||||
files={"file": file},
|
files={"file": file},
|
||||||
headers=self.default_headers | {"Content-Type": "application/json"},
|
headers=self.default_headers,
|
||||||
*args,
|
*args,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user