Exemplo n.º 1
0
    def test_get_tiles_asym_top(self):
        """testing making rows unevenly, normal"""

        x_dimension = 5
        increment = 2
        position = 0
        base = 0
        step = 1
        test_array = self.numpy_row_it(position, increment, x_dimension)
        self.assertEqual(Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[2].tolist(),
                         [[0, 1],
                          [5, 6]])
        self.assertEqual((Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[0],
                          Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[1]),
                         (0, 2))
Exemplo n.º 2
0
    def test_get_tiles_asym_bottom(self):
        """testing making rows unevenly, edge"""

        x_dimension = 5
        increment = 2
        position = x_dimension - (x_dimension % increment)
        base = 0
        step = 1
        # this function call is different because I am testing the uneven edge | uneven edge
        test_array = self.numpy_row_it(position, 1, x_dimension)
        self.assertEqual(Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[2].tolist(),
                         [[24]])
        self.assertEqual((Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[0],
                          Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[1]),
                         (4, 5))
Exemplo n.º 3
0
    def test_get_tiles_square_top(self):
        """testing making rows from square, top"""

        x_dimension = 9
        increment = 3
        position = 0
        base = 0
        step = 1
        test_array = self.numpy_row_it(position, increment, x_dimension)
        self.assertEqual(Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[2].tolist(),
                         [[0,  1,  2],
                          [9, 10, 11],
                          [18, 19, 20]])
        self.assertEqual((Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[0],
                          Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[1]),
                         (0, 3))
Exemplo n.º 4
0
    def test_get_tiles_square_bottom(self):
        """testing making rows from square, bottom"""

        x_dimension = 9
        increment = 3
        position = x_dimension - increment
        base = 0
        step = 1
        test_array = self.numpy_row_it(position, increment, x_dimension)
        self.assertEqual(Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[2].tolist(),
                         [[60, 61, 62],
                          [69, 70, 71],
                          [78, 79, 80]])
        self.assertEqual((Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[0],
                          Tile.get_tiles(test_array, position, x_dimension, increment, base, step)[1]),
                         (6, 9))