예제 #1
0
def test_get_cell():
    tile1 = Tile.from_2d_array([[Cell.Indoor, Cell.Outdoor],
                                [Cell.Indoor, Cell.Outdoor]])

    assert tile1.get_cell(Direction.TOP_LEFT) == tile1.tiles[0][0]
    assert tile1.get_cell(Direction.TOP_RIGHT) == tile1.tiles[0][1]

    assert tile1.get_cell(Direction.BOTTOM_LEFT) == tile1.tiles[1][0]
    assert tile1.get_cell(Direction.BOTTOM_RIGHT) == tile1.tiles[1][1]
예제 #2
0
def test_creates():
    tile1 = Tile.from_2d_array([[Cell.Indoor, Cell.Outdoor],
                                [Cell.Indoor, Cell.Outdoor]])

    assert tile1.get_cell(Direction.TOP_LEFT) == Cell.Indoor
    assert tile1.get_cell(Direction.TOP_RIGHT) == Cell.Outdoor

    assert tile1.get_cell(Direction.BOTTOM_LEFT) == Cell.Indoor
    assert tile1.get_cell(Direction.BOTTOM_RIGHT) == Cell.Outdoor
예제 #3
0
def test_find_match():
    tile1 = Tile.from_2d_array([[Cell.Indoor, Cell.Outdoor],
                                [Cell.Indoor, Cell.Outdoor]])
    tile2 = tile1.find_match()

    assert tile1.is_match(tile2)

    assert tile1.get_cell(Direction.TOP_LEFT) == tile2.get_cell(
        Direction.TOP_RIGHT)
    assert tile1.get_cell(Direction.TOP_RIGHT) == tile2.get_cell(
        Direction.TOP_LEFT)