def test_teams_announcements(self): player1 = Player("Boyan", "Team1") player2 = Player("Silvia", "Team1") player3 = Player("Freeman", "Team2") player4 = Player("Marto", "Team2") players = [[player1, player2], [player3, player4]] belote = Belote(players) annoucement = { player1: [('carre', 15)], player2: [('carre', 16)], player3: [('tierce', 10)], player4: [] } expected_result = [[{ 0: [('carre', 15)], 3: [('tierce', 10)] }, { 0: [('carre', 16)] }], [{ 0: [('carre', 15)] }, { 0: [('carre', 16)] }, { 3: [('tierce', 10)] }, {}]] result = belote.get_teams_announcements(annoucement) self.assertEqual(result, expected_result)
def test__validate(self): player1 = Player("Boyan", "Team1") player2 = Player("Silvia", "Team1") player3 = Player("Freeman", "Team2") player4 = Player("Marto", "Team2") players = [[player1, player2], [player3, player4]] belote = Belote(players) annoucement = { player1: [('carre', 12), ('carre', 15)], player2: [('carre', 16)], player3: [('tierce', 10)], player4: [('tierce', 11), ('belote', 2)] } expected_result = { player1: [], player2: [('carre', 16)], player3: [], player4: [('tierce', 11), ('belote', 2)] } belote.get_teams_announcements(annoucement) result = belote.validate_announcements(annoucement) self.assertEqual(result, expected_result)