Coverage for docs_src/bigger_applications/app/routers/users.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-05-05 00:03 +0000

1from fastapi import APIRouter 1abcdef

2 

3router = APIRouter() 1abcdef

4 

5 

6@router.get("/users/", tags=["users"]) 1abcdef

7async def read_users(): 1abcdef

8 return [{"username": "Rick"}, {"username": "Morty"}] 1ghijkl

9 

10 

11@router.get("/users/me", tags=["users"]) 1abcdef

12async def read_user_me(): 1abcdef

13 return {"username": "fakecurrentuser"} 1mnopqr

14 

15 

16@router.get("/users/{username}", tags=["users"]) 1abcdef

17async def read_user(username: str): 1abcdef

18 return {"username": username} 1stuvwx