Coverage for src/tests/modules/club/test_get_coach.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2024-01-01 00:00 +0000

1"""Module for testing the use case 'Get Coach'.""" 

2 

3import pytest 

4 

5from kwai_bc_club.domain.club_coach import ClubCoachEntity 

6from kwai_bc_club.get_coach import GetCoach, GetCoachCommand 

7from kwai_bc_club.repositories.coach_db_repository import CoachDbRepository 

8from kwai_core.domain.presenter import EntityPresenter 

9 

10 

11pytestmark = pytest.mark.db 

12 

13 

14async def test_get_coach(database, make_coach_in_db): 

15 """Test use case.""" 

16 coach = await make_coach_in_db() 

17 presenter = EntityPresenter[ClubCoachEntity]() 

18 await GetCoach(CoachDbRepository(database), presenter).execute( 

19 GetCoachCommand(uuid=str(coach.uuid)) 

20 ) 

21 assert presenter.entity is not None, "There should be a coach"