def test_set_scores(self): table = Table() table.init_round(0, 0, 0, 0, 0, []) scores = [230, 110, 55, 405] table.set_players_scores(scores) self.assertEqual(table.get_player(0).scores, 23000) self.assertEqual(table.get_player(1).scores, 11000) self.assertEqual(table.get_player(2).scores, 5500) self.assertEqual(table.get_player(3).scores, 40500)
def test_set_scores_and_uma(self): table = Table() table.init_round(0, 0, 0, 0, 0, []) scores = [230, 110, 55, 405] uma = [-17, 3, 48, -34] table.set_players_scores(scores, uma) self.assertEqual(table.get_player(0).scores, 23000) self.assertEqual(table.get_player(0).uma, -17) self.assertEqual(table.get_player(1).scores, 11000) self.assertEqual(table.get_player(1).uma, 3) self.assertEqual(table.get_player(2).scores, 5500) self.assertEqual(table.get_player(2).uma, 48) self.assertEqual(table.get_player(3).scores, 40500) self.assertEqual(table.get_player(3).uma, -34)
def test_set_scores_and_recalculate_player_position(self): table = Table() table.init_round(0, 0, 0, 0, 0, []) scores = [230, 110, 55, 405] table.set_players_scores(scores) self.assertEqual(table.get_player(0).position, 2) self.assertEqual(table.get_player(1).position, 3) self.assertEqual(table.get_player(2).position, 4) self.assertEqual(table.get_player(3).position, 1) scores = [110, 110, 405, 405] table.set_players_scores(scores) self.assertEqual(table.get_player(0).position, 3) self.assertEqual(table.get_player(1).position, 4) self.assertEqual(table.get_player(2).position, 1) self.assertEqual(table.get_player(3).position, 2)