def test_square_grid_coordinate(self): coord = SquareGridCoordinate(1, 2) assert coord.x == 1 assert coord.y == 2 moved = coord.move(1, 1) assert moved.x == 2 assert moved.y == 3 coord_2 = SquareGridCoordinate(1, 3) coord_3 = SquareGridCoordinate(1, 2) assert not coord == coord_2 assert coord == coord_3
def test_square_grid_coordinate(self): coord = SquareGridCoordinate(1, 2) assert coord.x == 1 assert coord.y == 2 moved = coord.move(1, 1, grid_size=10) # AM: add grid_size as new argument assert moved.x == 2 assert moved.y == 3 coord_2 = SquareGridCoordinate(1, 3) coord_3 = SquareGridCoordinate(1, 2) assert not coord == coord_2 assert coord == coord_3