示例#1
0
def test_cannot_position_tile_beyond_grid(position, x, y):
    from example import position_tile, Position, make_tile, make_grid
    grid = make_grid(5, 5)
    position = Position(*position)
    tile = make_tile('ship', position)
    grid = position_tile(grid, tile, position)
    assert grid[y][x] == tile
示例#2
0
def five_grid():
    from example import make_grid
    return make_grid(5, 5)
示例#3
0
def test_create_grid(x, y, expected):
    from example import make_grid
    grid = make_grid(x, y)
    assert expected == (len(grid[0]), len(grid))