Esempio n. 1
0
 def test_get_range(self):
     start = [
         1, 2, 3, 4,
         5, 6, 7, 8,
         9, 10, 11, 12,
         13, 14, 15, 16 
     ]
     row_first = [1, 2, 3, 4]
     row_last = [13, 14, 15, 16]
     col_first = [1, 5, 9, 13]
     col_last = [4, 8, 12, 16]
     board = Board(4, 4, start)
     self.assertEqual(row_first, board._Board__get_range(0, 'left'))
     self.assertEqual(row_first, board._Board__get_range(0, 'right'))
     self.assertEqual(row_last, board._Board__get_range(3, 'left'))
     self.assertEqual(row_last, board._Board__get_range(3, 'right'))
     self.assertEqual(col_first, board._Board__get_range(0, 'up'))
     self.assertEqual(col_first, board._Board__get_range(0, 'down'))
     self.assertEqual(col_last, board._Board__get_range(3, 'up'))
     self.assertEqual(col_last, board._Board__get_range(3, 'down'))