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

11 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-08 03:53 +0000

1from fastapi import APIRouter 1abcd

2 

3router = APIRouter() 1abcd

4 

5 

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

7async def read_users(): 1abcd

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

9 

10 

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

12async def read_user_me(): 1abcd

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

14 

15 

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

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

18 return {"username": username} 1abcd