def testChangeActiveTeam(self): game = Game("", [ClueSetType.BASE]) with self.subTest("Invalid change team not caught"): try: game._change_active_team() except InvalidState: pass else: self.fail() game.start_turn() game.current_turn_correct = game.words_per_turn - 1 game.end_active_state(True, 0) game._change_active_team() with self.subTest("Check active team change"): self.assertFalse(game.team_1_turn)
def testUpdateScore(self): game = Game("", [ClueSetType.BASE]) game._update_score(2) with self.subTest("Check team 1 update/team 1 active"): self.assertEqual(game.team_1_score, 2) game._update_score(1, False) with self.subTest("Check team2 update/team 1 active"): self.assertEqual(game.team_2_score, 1) game.reset("") game.state = State.REVIEW game._change_active_team() game._update_score(2) with self.subTest("Check team 2 update/team 2 active"): self.assertEqual(game.team_2_score, 2) game._update_score(1, False) with self.subTest("Check team 2 update/team 1 active"): self.assertEqual(game.team_1_score, 1)