Beispiel #1
0
 def test_grid_set_squares(self):
     grid = Blockies.Grid()
     square = (0, 9)
     grid.set_square(square,
                     Blockies.Piece('square', 1, 1, square, const.BLUE))
     self.assertIsNotNone(grid._squares[0][9])
     self.assertIsNone(grid._squares[1][8])
Beispiel #2
0
 def test_grid_set_squares_3x_piece(self):
     grid = Blockies.Grid()
     square = (1, 2)
     grid.set_square(square,
                     Blockies.Piece('square', 3, 1, square, const.BLUE))
     self.assertIsNotNone(grid._squares[1][2])
     self.assertIsNotNone(grid._squares[2][2])
     self.assertIsNotNone(grid._squares[3][2])
     self.assertIsNone(grid._squares[4][2])
     self.assertIsNone(grid._squares[5][2])
     self.assertIsNone(grid._squares[0][2])
Beispiel #3
0
 def test_grid_print(self):
     grid = Blockies.Grid()
     from pprint import pprint
     pprint(grid._display())
Beispiel #4
0
    def test_grid(self):
        grid = Blockies.Grid()

        self.assertEqual(len(grid._squares), 10)
        self.assertEqual(len(grid._squares[0]), 10)