Skip to content

Commit 2caddde

Browse files
committed
Fix formatting
1 parent f29e629 commit 2caddde

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

app/api/users.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from fastapi import APIRouter, HTTPException
1+
from fastapi import APIRouter
2+
23
from app.models.user import User, UserCreate
34
from app.services.user_service import save_user, get_all_users
45

app/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import sys
33

44
from fastapi import FastAPI
5+
56
from app.api import users
67

7-
log_format = '%(asctime)s | %(levelname)-8s | %(name)-12s - %(message)s'
8+
log_format = "%(asctime)s | %(levelname)-8s | %(name)-12s - %(message)s"
89
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format=log_format)
910

1011
app = FastAPI(title="Python FastAPI Template", version="0.1.0")

tests/api/test_users.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
async def test_create_user():
99
transport = httpx.ASGITransport(app=app)
1010
async with httpx.AsyncClient(transport=transport, base_url="http://test") as ac:
11-
response = await ac.post("/api/v1/users/", json={"name": "Simone", "email": "simone@example.com"})
11+
response = await ac.post(
12+
"/api/v1/users/", json={"name": "Simone", "email": "simone@example.com"}
13+
)
1214
assert response.status_code == 200
1315
data = response.json()
1416
assert data["name"] == "Simone"
1517
assert data["email"] == "simone@example.com"
1618

19+
1720
@pytest.mark.asyncio
1821
async def test_get_users():
1922
transport = httpx.ASGITransport(app=app)

tests/services/test_user_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
from app.models.user import UserCreate
34
from app.services.user_service import save_user, get_all_users
45

0 commit comments

Comments
 (0)