Example #1
0
def test_gat_tile_has_correct_heights(data_files, x, y, heights):
    gat = open_gat(data_files['a.gat'])
    bottom_left, bottom_right, top_left, top_right = heights
    tile = gat[x, y]
    assert tile.bottom_left == bottom_left
    assert tile.bottom_right == bottom_right
    assert tile.top_left == top_left
    assert tile.top_right == top_right
Example #2
0
def test_gat_tile_raise_index_error_bad_coordinates(data_files, x, y):
    gat = open_gat(data_files['a.gat'])
    with pytest.raises(IndexError):
        gat[x, y]
Example #3
0
def test_gat_has_correct_width(data_files, name, expected):
    gat = open_gat(data_files[name])
    assert gat.width == expected
Example #4
0
def test_gat_tile_has_correct_altitude(data_files, x, y, altitude):
    gat = open_gat(data_files['a.gat'])
    tile = gat[x, y]
    assert tile.altitude == altitude
Example #5
0
def test_gat_tile_has_correct_type(data_files, x, y, expected):
    gat = open_gat(data_files['a.gat'])
    tile = gat[x, y]
    assert tile.type == expected
Example #6
0
def test_gat_data_matches_source_data(data_files, name):
    source = open(data_files[name], 'rb')
    gat = open_gat(data_files[name])
    assert gat.read() == source.read()
Example #7
0
def test_gat_is_io_object(data_files):
    gat = open_gat(data_files['a.gat'])
    assert isinstance(gat, io.IOBase)
Example #8
0
def test_open_gat_raises_gat_error(data_files, name):
    with pytest.raises(FileParseError):
        open_gat(data_files[name])
Example #9
0
def test_gat_has_correct_size(data_files, name):
    gat = open_gat(data_files[name])
    assert gat.size == (gat.width, gat.height)
Example #10
0
def test_gat_has_correct_height(data_files, name, expected):
    gat = open_gat(data_files[name])
    assert gat.height == expected