[READY][Gameplay] #310 Host transition idempotency and error catalog for scoreboard -> next round / finish #320
@@ -1,3 +1,4 @@
|
|||||||
|
import inspect
|
||||||
import json
|
import json
|
||||||
import tempfile
|
import tempfile
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
@@ -60,6 +61,24 @@ class LobbyGameplayExtractionTests(TestCase):
|
|||||||
self.assertIs(lobby_views._finish_game, gameplay_services.finish_game)
|
self.assertIs(lobby_views._finish_game, gameplay_services.finish_game)
|
||||||
self.assertIs(lobby_views._build_scoreboard_phase_event, gameplay_payloads.build_scoreboard_phase_event)
|
self.assertIs(lobby_views._build_scoreboard_phase_event, gameplay_payloads.build_scoreboard_phase_event)
|
||||||
|
|
||||||
|
def test_start_next_round_view_source_stays_http_thin(self):
|
||||||
|
source = inspect.getsource(inspect.unwrap(lobby_views.start_next_round))
|
||||||
|
|
||||||
|
self.assertIn("transition = _start_next_round(session)", source)
|
||||||
|
self.assertNotIn("RoundConfig", source)
|
||||||
|
self.assertNotIn("RoundQuestion", source)
|
||||||
|
self.assertNotIn("build_start_next_round_response", source)
|
||||||
|
self.assertNotIn("build_start_next_round_phase_event", source)
|
||||||
|
|
||||||
|
def test_finish_game_view_source_stays_http_thin(self):
|
||||||
|
source = inspect.getsource(inspect.unwrap(lobby_views.finish_game))
|
||||||
|
|
||||||
|
self.assertIn("transition = _finish_game(session)", source)
|
||||||
|
self.assertNotIn("RoundConfig", source)
|
||||||
|
self.assertNotIn("RoundQuestion", source)
|
||||||
|
self.assertNotIn("build_finish_game_response", source)
|
||||||
|
self.assertNotIn("build_finish_game_phase_event", source)
|
||||||
|
|
||||||
@patch("lobby.views.sync_broadcast_phase_event")
|
@patch("lobby.views.sync_broadcast_phase_event")
|
||||||
@patch("lobby.views._start_next_round")
|
@patch("lobby.views._start_next_round")
|
||||||
def test_start_next_round_view_delegates_transition_to_service(
|
def test_start_next_round_view_delegates_transition_to_service(
|
||||||
|
|||||||
Reference in New Issue
Block a user