diff --git a/tests/whist_server/api/room/test_info.py b/tests/whist_server/api/room/test_info.py index de320205..f5abedc1 100644 --- a/tests/whist_server/api/room/test_info.py +++ b/tests/whist_server/api/room/test_info.py @@ -48,7 +48,7 @@ def test_get_all_ids_require_login(self): def test_get_room_info(self): expected_info = RoomInfo(name='test', password=True, rubber_number=0, game_number=0, hand_number=0, trick_number=0, min_player=2, - max_player=2, player_number=1) + max_player=2, players=[self.player_mock]) self.room_mock.get_info = MagicMock(return_value=expected_info) self.room_service_mock.get = MagicMock(return_value=self.room_mock) response = self.client.get(f'/room/info/{self.room_mock.id}') diff --git a/tests/whist_server/database/test_room.py b/tests/whist_server/database/test_room.py index e891b93d..fce91db3 100644 --- a/tests/whist_server/database/test_room.py +++ b/tests/whist_server/database/test_room.py @@ -82,7 +82,7 @@ def test_room_info(self): room_info = self.room.get_info() expected_info = RoomInfo(name='test', password=True, rubber_number=0, game_number=0, hand_number=0, trick_number=0, min_player=2, - max_player=2, player_number=1) + max_player=2, players=[self.player]) self.assertEqual(expected_info, room_info) def test_room_info_no_pwd(self): @@ -90,5 +90,5 @@ def test_room_info_no_pwd(self): room_info = self.room.get_info() expected_info = RoomInfo(name='test', password=False, rubber_number=0, game_number=0, hand_number=0, trick_number=0, min_player=2, - max_player=2, player_number=1) + max_player=2, players=[self.player]) self.assertEqual(expected_info, room_info) diff --git a/whist_server/database/room.py b/whist_server/database/room.py index c809f185..b05cce36 100644 --- a/whist_server/database/room.py +++ b/whist_server/database/room.py @@ -191,7 +191,7 @@ class RoomInfo(BaseModel): trick_number: int min_player: int max_player: int - player_number: int + players: list[Player] @staticmethod def from_room(room: RoomInDb) -> 'RoomInfo': @@ -212,4 +212,4 @@ def from_room(room: RoomInDb) -> 'RoomInfo': trick_number=trick_number, min_player=room.table.min_player, max_player=room.table.max_player, - player_number=len(room.table.users)) + players=room.table.users.players)