Coverage for src/auth/api/account_controller.py: 100%

1 from litestar import Controller, post

2 from litestar.di import Provide

3 import msgspec

4

5 from src.auth.services import AuthService, provide_auth_service

6

7

8 class SignUpRequestScheme(msgspec.Struct):

9 email: str

10 password: str

11

12

13 class SignUpResponseScheme(msgspec.Struct):

14 message: str

15

16

17 class AccountController(Controller):

18 path = "/account"

19

20 dependencies = {"auth_service": Provide(provide_auth_service)}

21

22 @post("/signup")

23 async def sign_up(self, data: SignUpRequestScheme, auth_service: AuthService) -> SignUpResponseScheme:

24 return SignUpResponseScheme(message="success")