Beispiel #1
0
    def test_with_announcements_which_are_not_killed_return_list_with_announcements(
            self):
        res = final_announcements({'belote': [['12h', '13h']]},
                                  {'belote': [['12h', '13h'], ['12d', '13d']]})
        res2 = final_announcements(
            {'belote': [['12d', '13d']]},
            {'belote': [['12h', '13h'], ['12d', '13d']]})

        self.assertEqual(res, ['belote'])
        self.assertEqual(res2, ['belote'])
Beispiel #2
0
    def test_with_announcements_which_are_killed_return_list_with_announcements(
            self):
        res = final_announcements({'tierce': [['7h', '8h', '9h']]},
                                  {'tierce': []})
        res2 = final_announcements(
            {
                'belote': [['12d', '13d']],
                'tierce': [['7h', '8h', '9h']]
            }, {
                'belote': [['12d', '13d']],
                'tierce': []
            })

        self.assertEqual(res, [])
        self.assertEqual(res2, ['belote'])
Beispiel #3
0
    def add_announcements_to_players(self, call="All trumps"):
        announcements_first_player = announcements(sort(self.teams_lst[0].lst_players[0].cards), call)
        announcements_third_player = announcements(sort(self.teams_lst[0].lst_players[1].cards), call)

        announcements_second_player = announcements(sort(self.teams_lst[1].lst_players[0].cards), call)
        announcements_four_player = announcements(sort(self.teams_lst[1].lst_players[1].cards), call)

        announcements_of_the_first_team = team_announcements(announcements_first_player, announcements_third_player)
        announcements_of_the_second_team = team_announcements(announcements_second_player, announcements_four_player)

        new_announcements_first_team = compare_team_announcements(announcements_of_the_first_team, announcements_of_the_second_team)[0]
        new_announcements_second_team = compare_team_announcements(announcements_of_the_first_team, announcements_of_the_second_team)[1]

        self.teams_lst[0].lst_players[0].announcements = final_announcements(announcements_first_player, new_announcements_first_team)
        self.teams_lst[0].lst_players[1].announcements = final_announcements(announcements_third_player, new_announcements_first_team)
        self.teams_lst[1].lst_players[0].announcements = final_announcements(announcements_second_player, new_announcements_second_team)
        self.teams_lst[1].lst_players[1].announcements = final_announcements(announcements_four_player, new_announcements_second_team)
Beispiel #4
0
    def test_with_one_announcements_of_the_one_player_and_one_of_the_other_return_announcements_of_the_player(
            self):
        res = final_announcements({'tierce': [['9d', '10d', '11d']]}, {
            'tierce': [['9d', '10d', '11d'], ['11s', '12s', '13s']],
            'belote': [['12s', '13s']]
        })

        self.assertEqual(res, ['tierce'])
Beispiel #5
0
    def test_with_no_announcements_of_the_one_player_empty_list_with_announcements(
            self):
        res = final_announcements({}, {'tierce': [['7d', '8d', '9d']]})

        self.assertEqual(res, [])
Beispiel #6
0
    def test_with_no_announcements_return_empty_list(self):
        res = final_announcements({}, {})

        self.assertEqual(res, [])