Beispiel #1
0
 def test_fourth_column(self):
     """
     Tests the number of similarities between pieces for each characteristic
     along the fourth column of pieces is the expected number of similarities
     """
     test = Game()
     test.board = [[None, '1000', '0001', None],
                   [None, '0000', '0010', '0111'],
                   ['1001', None, '1111', '1011'],
                   ['0100', '0110', '0011', '1110']]
     self.assertEqual([1, 2, 3, 1], test.bin_count('0110', 0, 3, 1, 0, 3))
Beispiel #2
0
 def test_one_block(self):
     """
     Tests the number of similarities between pieces for each characteristic
     along one block of pieces is the expected number of similarities
     """
     test = Game()
     test.board = [[None, '1000', '0001', None],
                   [None, '0000', '0010', '0111'],
                   ['1001', None, '1111', '1011'],
                   ['0100', '0110', '0011', '1110']]
     self.assertEqual([1, 0, 0, 1], test.bin_count('0110', 0, 0, 1, 1, 1))
Beispiel #3
0
 def test_third_row(self):
     """
     Tests the number of similarities between pieces for each characteristic
     along the third row of pieces is the expected number of similarities
     """
     test = Game()
     test.board = [[None, '1000', '0001', '0101'],
                   [None, '0000', '0010', '0111'],
                   ['1001', None, '1111', '1011'],
                   ['0100', '0110', '0011', '1110']]
     self.assertEqual([0, 1, 2, 0], test.bin_count('0110', 2, 1, 0, 1, 3))
Beispiel #4
0
 def test_horizontal_two(self):
     """
     Tests the number of similarities between pieces for each characteristic
     along a horizontal row of pieces is the expected number of similarities
     """
     test = Game()
     test.board = [[None, '1000', '0001', None],
                   [None, '0000', '0010', '0111'],
                   ['1001', None, '1111', '1011'],
                   ['0100', '0110', '0011', '1110']]
     self.assertEqual([1, 2, 2, 2], test.bin_count('0110', 0, 0, 1, 1, 3))