mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-11-30 13:20:40 +03:00
lint and format
This commit is contained in:
@@ -5,14 +5,10 @@ import jwt
|
||||
|
||||
pytestmark = pytest.mark.anyio
|
||||
|
||||
|
||||
# TODO: parametrize test with diff urls
|
||||
async def test_add_user(client: AsyncClient):
|
||||
payload = {
|
||||
"email": "rancher@grassroots.com",
|
||||
"first_name": "Joe",
|
||||
"last_name": "Garcia",
|
||||
"password": "s1lly"
|
||||
}
|
||||
payload = {"email": "rancher@grassroots.com", "first_name": "Joe", "last_name": "Garcia", "password": "s1lly"}
|
||||
response = await client.post("/user/", json=payload)
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
claimset = jwt.decode(response.json()["access_token"], options={"verify_signature": False})
|
||||
@@ -32,4 +28,5 @@ async def test_get_token(client: AsyncClient):
|
||||
assert claimset["platform"] == "python-httpx/0.24.1"
|
||||
|
||||
|
||||
# TODO: baerer token test > get token > test endpoint auth with token > expire token on redis > test endpoint auth with token
|
||||
# TODO: baerer token test
|
||||
# TODO: > get token > test endpoint auth with token > expire token on redis > test endpoint auth with token
|
||||
|
||||
@@ -4,8 +4,9 @@ from httpx import AsyncClient
|
||||
|
||||
pytestmark = pytest.mark.anyio
|
||||
|
||||
|
||||
async def test_redis_health(client: AsyncClient):
|
||||
response = await client.get(f"/public/health/redis")
|
||||
response = await client.get("/public/health/redis")
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
# assert payload["name"] == response.json()["name"]
|
||||
# assert UUID(response.json()["id"])
|
||||
|
||||
@@ -11,7 +11,7 @@ from app.redis import get_redis
|
||||
scope="session",
|
||||
params=[
|
||||
pytest.param(("asyncio", {"use_uvloop": True}), id="asyncio+uvloop"),
|
||||
]
|
||||
],
|
||||
)
|
||||
def anyio_backend(request):
|
||||
return request.param
|
||||
|
||||
Reference in New Issue
Block a user