Exemple #1
0
    def test_with_quinte_from_one_team_and_quinte_in_the_other_team_which_are_not_equal(
            self):
        res = compare_team_announcements(
            {'quinte': [['7h', '8h', '9h', '10h', '11h']]}, {
                'quinte': [['8d', '9d', '10d', '11d', '12d'],
                           ['7s', '8s', '9s', '10s', '11s']]
            })
        res2 = compare_team_announcements(
            {
                'quinte': [['8d', '9d', '10d', '11d', '12d'],
                           ['7s', '8s', '9s', '10s', '11s']]
            }, {'quinte': [['7h', '8h', '9h', '10h', '11h']]})

        self.assertEqual(res, [{
            'quinte': []
        }, {
            'quinte': [['8d', '9d', '10d', '11d', '12d'],
                       ['7s', '8s', '9s', '10s', '11s']]
        }])
        self.assertEqual(res2, [{
            'quinte': [['8d', '9d', '10d', '11d', '12d'],
                       ['7s', '8s', '9s', '10s', '11s']]
        }, {
            'quinte': []
        }])
Exemple #2
0
    def test_with_one_empty_announcement_returns_list_with_empty_dictionarie_of_that_empty_team(
            self):
        res = compare_team_announcements({'belote': [['12s', '13s']]}, {})
        res2 = compare_team_announcements({}, {'belote': [['12s', '13s']]})

        self.assertEqual(res, [{'belote': [['12s', '13s']]}, {}])
        self.assertEqual(res2, [{}, {'belote': [['12s', '13s']]}])
Exemple #3
0
    def test_with_tierces_from_one_team_and_tierces_in_the_other_team_which_are_equal(
            self):
        res = compare_team_announcements({'tierce': [['7h', '8h', '9h']]},
                                         {'tierce': [['7s', '8s', '9s']]})
        res2 = compare_team_announcements(
            {'tierce': [['9d', '10d', '11d'], ['7s', '8s', '9s']]},
            {'tierce': [['7h', '8h', '9h'], ['9c', '10c', '11c']]})

        self.assertEqual(res, [{'tierce': []}, {'tierce': []}])
        self.assertEqual(res2, [{'tierce': []}, {'tierce': []}])
Exemple #4
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)
Exemple #5
0
 def test_with_announcements_which_dont_kill_the_each_other_returns_list_with_dictionaries(
         self):
     res = compare_team_announcements({'belote': [['12s', '13s']]},
                                      {'tierce': [['8h', '9h', '10h']]})
     self.assertEqual(res, [{
         'belote': [['12s', '13s']]
     }, {
         'tierce': [['8h', '9h', '10h']]
     }])
Exemple #6
0
    def test_with_quatre_from_one_team_and_quinte_in_the_other_team(self):
        res = compare_team_announcements(
            {'quatre': [['7h', '8h', '9h', '10h']]},
            {'quinte': [['7s', '8s', '9s', '10s', '11s']]})

        self.assertEqual(res, [{
            'quatre': []
        }, {
            'quinte': [['7s', '8s', '9s', '10s', '11s']]
        }])
Exemple #7
0
    def test_with_two_empty_announcements_returns_list_with_two_empty_dictionaries(
            self):
        res = compare_team_announcements({}, {})

        self.assertEqual(res, [{}, {}])