Esempio n. 1
0
    def test_with_first_team_low_tierce_second_team_high_tierce_should_only_second_stay(self):
        p1, p2, p3, p4 = Player(name='ime1'), Player(name='ime2'),\
         Player(name='ime3'), Player(name='ime4')
        t1, t2 = Team('prqkor1', p1, p3), Team('prqkor2', p2, p4)
        r = Round(1, t1, t2)
        p1.announcements = {BELOTE_TIERCE_STRING: [Card('9', 's')]}
        p2.announcements = {BELOTE_TIERCE_STRING: [Card('Q', 's')]}

        r.check_tierce()

        self.assertNotIn(BELOTE_TIERCE_STRING, p1.announcements.keys())
        self.assertEqual(p2.announcements[BELOTE_TIERCE_STRING], [Card('Q', 's')])
Esempio n. 2
0
    def test_with_one_tierce(self):
        p1, p2, p3, p4 = Player(name='ime1'), Player(name='ime2'),\
         Player(name='ime3'), Player(name='ime4')
        t1, t2 = Team('prqkor1', p1, p3), Team('prqkor2', p2, p4)
        r = Round(1, t1, t2)
        p1.announcements = {BELOTE_TIERCE_STRING: [Card('9', 's')]}
        p2.announcements = {}
        p3.announcements = {}
        p4.announcements = {}

        r.check_tierce()

        self.assertEqual(p1.announcements[BELOTE_TIERCE_STRING], [Card('9', 's')])
        self.assertNotIn(BELOTE_TIERCE_STRING, p2.announcements.keys())
        self.assertNotIn(BELOTE_TIERCE_STRING, p3.announcements.keys())
        self.assertNotIn(BELOTE_TIERCE_STRING, p4.announcements.keys())