コード例 #1
0
 def test_all_different(self):
     game = SetGame()
     game.hand = [['empty', 'blue', 'squiggly', 1],
                  ['striped', 'green', 'squiggly', 2],
                  ['empty', 'red', 'squiggly', 3]]
     game.triplet = [0, 1, 2]
     self.assertEqual(False, game.all_different(0))
     self.assertEqual(True, game.all_different(1))
     self.assertEqual(False, game.all_different(2))
     self.assertEqual(True, game.all_different(3))
コード例 #2
0
 def test_check_match(self):
     game = SetGame()
     game.triplet = [0, 1, 2]
     game.hand = [['empty', 'blue', 'squiggly', 1],
                  ['striped', 'green', 'squiggly', 2],
                  ['empty', 'red', 'squiggly', 3]]
     self.assertEqual(False, game.check_match())
     game.hand = [['empty', 'blue', 'squiggly', 1],
                  ['striped', 'green', 'squiggly', 2],
                  ['full', 'red', 'squiggly', 3]]
     self.assertEqual(True, game.check_match())