コード例 #1
0
    def test_check_if_hand_has_zero_belots(self):
        pl = Player()
        pl.check_if_hand_contains_belots(
            ['7s', '8d', '9s', '10c', 'Qd', 'Qh', 'As', 'Ah'], 'All Trumps')

        self.assertEqual(pl.points, 0)
        self.assertEqual(pl.belots, [])
コード例 #2
0
    def test_check_if_hand_contains_belots_works_with_not_matching_belots_and_contract(
            self):
        player = Player()
        player.check_if_hand_contains_belots(['Qs', 'Ks'], 'Hearts')

        self.assertEqual(player.points, 0)
        self.assertEqual(player.belots, [])
コード例 #3
0
    def test_check_if_hand_contains_multiple_belots_and_contract_is_All_Trumps(
            self):
        player = Player()
        player.check_if_hand_contains_belots(['Qs', 'Ks', 'Qh', 'Kh'],
                                             'All Trumps')

        self.assertEqual(player.points, 40)
        self.assertEqual(player.belots, [['Qs', 'Ks'], ['Qh', 'Kh']])
コード例 #4
0
    def test_check_if_hand_contains_multiple_belots_and_contract_covers_only_one(
            self):
        player = Player()
        player.check_if_hand_contains_belots(['Qs', 'Ks', 'Qh', 'Kh'],
                                             'Hearts')

        self.assertEqual(player.points, 20)
        self.assertEqual(player.belots, [['Qh', 'Kh']])