Skip to content

Commit f77ab40

Browse files
author
Jakub Miazek
committed
lint and format
1 parent 2fb3035 commit f77ab40

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

app/services/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def verify_jwt(request: Request, token: str) -> bool:
2020

2121
class AuthBearer(HTTPBearer):
2222
def __init__(self, auto_error: bool = True):
23-
super(AuthBearer, self).__init__(auto_error=auto_error)
23+
super().__init__(auto_error=auto_error)
2424

2525
async def __call__(self, request: Request):
2626
credentials: HTTPAuthorizationCredentials = await super(AuthBearer, self).__call__(request)

tests/api/test_auth.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@
55

66
pytestmark = pytest.mark.anyio
77

8+
89
# TODO: parametrize test with diff urls
910
async def test_add_user(client: AsyncClient):
10-
payload = {
11-
"email": "rancher@grassroots.com",
12-
"first_name": "Joe",
13-
"last_name": "Garcia",
14-
"password": "s1lly"
15-
}
11+
payload = {"email": "rancher@grassroots.com", "first_name": "Joe", "last_name": "Garcia", "password": "s1lly"}
1612
response = await client.post("/user/", json=payload)
1713
assert response.status_code == status.HTTP_201_CREATED
1814
claimset = jwt.decode(response.json()["access_token"], options={"verify_signature": False})
@@ -32,4 +28,5 @@ async def test_get_token(client: AsyncClient):
3228
assert claimset["platform"] == "python-httpx/0.24.1"
3329

3430

35-
# TODO: baerer token test > get token > test endpoint auth with token > expire token on redis > test endpoint auth with token
31+
# TODO: baerer token test
32+
# TODO: > get token > test endpoint auth with token > expire token on redis > test endpoint auth with token

tests/api/test_health.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
pytestmark = pytest.mark.anyio
66

7+
78
async def test_redis_health(client: AsyncClient):
8-
response = await client.get(f"/public/health/redis")
9+
response = await client.get("/public/health/redis")
910
assert response.status_code == status.HTTP_200_OK
1011
# assert payload["name"] == response.json()["name"]
1112
# assert UUID(response.json()["id"])

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
scope="session",
1212
params=[
1313
pytest.param(("asyncio", {"use_uvloop": True}), id="asyncio+uvloop"),
14-
]
14+
],
1515
)
1616
def anyio_backend(request):
1717
return request.param

0 commit comments

Comments
 (0)