mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-12 19:30:30 +02:00
fix: Async Testing (#26)
* fix: httpx fix as per latest version * fix: Fix Async Testing client
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import json
|
||||
from httpx import AsyncClient, ASGITransport
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
|
||||
class AsyncGenericClient:
|
||||
def __init__(self, app):
|
||||
self.c = AsyncClient(
|
||||
transport=ASGITransport(app=app), base_url="http://testserver", follow_redirects=True
|
||||
)
|
||||
self.default_headers = {}
|
||||
def __init__(self, app, headers = {}):
|
||||
self.c = AsyncClient(transport=ASGITransport(app=app), base_url="http://testserver", follow_redirects=True)
|
||||
self.default_headers = headers
|
||||
|
||||
async def get(self, url: str, r_code: int = 200, parse_json=True):
|
||||
re = await self.c.get(url, headers=self.default_headers)
|
||||
|
||||
Reference in New Issue
Block a user