Esempio n. 1
0
    def test_win_mighty(self):
        cards = [
            {
                'rank': 'JK',
                'suit': 'S'
            },
            {
                'rank': 'A',
                'suit': 'S'
            },
            {
                'rank': 'A',
                'suit': 'C'
            },
            {
                'rank': 'A',
                'suit': 'D'
            },
            {
                'rank': 'K',
                'suit': 'S'
            },
        ]

        win = win_card(cards, 'C', False)
        self.assertEqual(win, 1)
        win = win_card(cards, 'S', False)
        self.assertEqual(win, 3)
Esempio n. 2
0
    def test_win_table_suit(self):
        cards = [
            {
                'rank': 'K',
                'suit': 'D'
            },
            {
                'rank': '2',
                'suit': 'D'
            },
            {
                'rank': 'A',
                'suit': 'D'
            },
            {
                'rank': 'J',
                'suit': 'D'
            },
            {
                'rank': 'Q',
                'suit': 'D'
            },
        ]

        win = win_card(cards, 'N', False)
        self.assertEqual(win, 2)
        win = win_card(cards, 'C', False)
        self.assertEqual(win, 2)
Esempio n. 3
0
    def test_win_first_turn_joker(self):
        cards = [
            {
                'rank': '3',
                'suit': 'C'
            },
            {
                'rank': '2',
                'suit': 'D'
            },
            {
                'rank': 'A',
                'suit': 'C'
            },
            {
                'rank': 'JK',
                'suit': None
            },
            {
                'rank': 'K',
                'suit': 'C'
            },
        ]

        win = win_card(cards, 'H', False, round=1)
        self.assertEqual(win, 2)
Esempio n. 4
0
    def test_win_joker_call(self):
        cards = [
            {
                'rank': '3',
                'suit': 'C'
            },
            {
                'rank': '2',
                'suit': 'D'
            },
            {
                'rank': 'A',
                'suit': 'C'
            },
            {
                'rank': 'JK',
                'suit': None
            },
            {
                'rank': 'K',
                'suit': 'C'
            },
        ]

        win = win_card(cards, 'H', True)
        self.assertEqual(win, 2)
Esempio n. 5
0
    def test_win_joker(self):
        cards = [
            {
                'rank': 'A',
                'suit': 'H'
            },
            {
                'rank': 'A',
                'suit': 'D'
            },
            {
                'rank': 'A',
                'suit': 'C'
            },
            {
                'rank': 'JK',
                'suit': None
            },
            {
                'rank': 'K',
                'suit': 'S'
            },
        ]

        win = win_card(cards, 'C', False)
        self.assertEqual(win, 3)
Esempio n. 6
0
    def test_win_giruda(self):
        cards = [
            {
                'rank': 'K',
                'suit': 'D'
            },
            {
                'rank': 'A',
                'suit': 'D'
            },
            {
                'rank': '2',
                'suit': 'C'
            },
            {
                'rank': 'J',
                'suit': 'C'
            },
            {
                'rank': 'Q',
                'suit': 'D'
            },
        ]

        win = win_card(cards, 'C', False)
        self.assertEqual(win, 3)
Esempio n. 7
0
    def test_win_not_five_cards(self):
        cards = [{'rank': '2', 'suit': 'S'}]

        win = win_card(cards, 'H', False)
        self.assertEqual(win, 0)

        cards = [
            {
                'rank': '2',
                'suit': 'S'
            },
            {
                'rank': '4',
                'suit': 'S'
            },
            {
                'rank': '3',
                'suit': 'S'
            },
        ]

        win = win_card(cards, 'H', False)
        self.assertEqual(win, 1)