def test_compare_cards_rechte(self): world = WorldWatten() # if weli is rechte, then it should win world.rank = 8 world.suit = 1 card_id_one = watten.get_id(8, 3) card_id_two = watten.get_id(5, 1) self.assertTrue(world.compare_cards(card_id_one, card_id_two)) self.assertFalse(world.compare_cards(card_id_two, card_id_one)) world.rank = 5 world.suit = 2 card_id_one = watten.get_id(5, 2) card_id_two = watten.get_id(4, 2) self.assertTrue(world.compare_cards(card_id_one, card_id_two)) self.assertFalse(world.compare_cards(card_id_two, card_id_one)) # if weli is rechte, then it should win world.rank = 8 world.suit = 1 card_id_one = watten.get_id(4, 3) card_id_two = watten.get_id(8, 3) self.assertFalse(world.compare_cards(card_id_one, card_id_two))
def test_compare_cards_second_is_trumpfe(self): world = WorldWatten() world.refresh() world.rank = 4 world.suit = 2 card_id_one = watten.get_id(3, 1) card_id_two = watten.get_id(5, 2) self.assertFalse(world.compare_cards(card_id_one, card_id_two)) world.rank = 7 world.suit = 1 card_id_one = watten.get_id(6, 3) card_id_two = watten.get_id(0, 1) self.assertFalse(world.compare_cards(card_id_one, card_id_two)) world.rank = 8 world.suit = 3 card_id_one = watten.get_id(2, 1) card_id_two = watten.get_id(8, 3) self.assertFalse(world.compare_cards(card_id_one, card_id_two)) world.rank = 2 world.suit = 3 card_id_one = watten.get_id(4, 3) card_id_two = watten.get_id(8, 3) self.assertTrue(world.compare_cards(card_id_one, card_id_two))
def test_compare_cards_first_is_trumpfe(self): world = WorldWatten() world.refresh() # only the first card is trümpfe world.rank = 4 world.suit = 2 card_id_one = watten.get_id(3, 2) card_id_two = watten.get_id(5, 1) self.assertTrue(world.compare_cards(card_id_one, card_id_two)) world.rank = 6 world.suit = 1 card_id_one = watten.get_id(4, 1) card_id_two = watten.get_id(7, 0) self.assertTrue(world.compare_cards(card_id_one, card_id_two)) # both cards are trümpfe world.rank = 4 world.suit = 2 card_id_one = watten.get_id(6, 2) card_id_two = watten.get_id(5, 2) self.assertTrue(world.compare_cards(card_id_one, card_id_two)) self.assertFalse(world.compare_cards(card_id_two, card_id_one)) world.rank = 7 world.suit = 1 card_id_one = watten.get_id(5, 1) card_id_two = watten.get_id(6, 1) self.assertFalse(world.compare_cards(card_id_one, card_id_two)) self.assertTrue(world.compare_cards(card_id_two, card_id_one)) world.rank = 8 world.suit = 3 card_id_one = watten.get_id(8, 3) card_id_two = watten.get_id(2, 1) self.assertTrue(world.compare_cards(card_id_one, card_id_two))
def test_compare_cards_blinde(self): world = WorldWatten() world.refresh() world.rank = 4 world.suit = 2 card_id_one = watten.get_id(8, 3) card_id_two = watten.get_id(4, 1) self.assertFalse(world.compare_cards(card_id_one, card_id_two)) self.assertTrue(world.compare_cards(card_id_two, card_id_one)) world.rank = 5 world.suit = 1 card_id_one = watten.get_id(5, 3) card_id_two = watten.get_id(5, 1) self.assertFalse(world.compare_cards(card_id_one, card_id_two)) self.assertTrue(world.compare_cards(card_id_two, card_id_one)) world.rank = 8 world.suit = 3 card_id_one = watten.get_id(8, 3) card_id_two = watten.get_id(5, 1) self.assertTrue(world.compare_cards(card_id_one, card_id_two)) self.assertFalse(world.compare_cards(card_id_two, card_id_one)) world.rank = 4 world.suit = 0 card_id_one = watten.get_id(3, 0) card_id_two = watten.get_id(4, 1) self.assertFalse(world.compare_cards(card_id_one, card_id_two)) self.assertTrue(world.compare_cards(card_id_two, card_id_one))
def test_compare_cards_no_trumpfe(self): world = WorldWatten() world.refresh() # different suit world.rank = 6 world.suit = 1 card_id_one = watten.get_id(5, 2) card_id_two = watten.get_id(3, 0) self.assertTrue(world.compare_cards(card_id_one, card_id_two)) self.assertTrue(world.compare_cards(card_id_two, card_id_one)) world.rank = 4 world.suit = 0 card_id_one = watten.get_id(6, 1) card_id_two = watten.get_id(7, 2) self.assertTrue(world.compare_cards(card_id_one, card_id_two)) self.assertTrue(world.compare_cards(card_id_two, card_id_one)) # same suit world.rank = 7 world.suit = 2 card_id_one = watten.get_id(5, 1) card_id_two = watten.get_id(3, 1) self.assertTrue(world.compare_cards(card_id_one, card_id_two)) self.assertFalse(world.compare_cards(card_id_two, card_id_one)) world.rank = 4 world.suit = 0 card_id_one = watten.get_id(1, 3) card_id_two = watten.get_id(5, 3) self.assertFalse(world.compare_cards(card_id_one, card_id_two)) self.assertTrue(world.compare_cards(card_id_two, card_id_one))