예제 #1
0
파일: test_gat.py 프로젝트: bmeinka/pygrf
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
예제 #2
0
파일: test_gat.py 프로젝트: bmeinka/pygrf
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]
예제 #3
0
파일: test_gat.py 프로젝트: bmeinka/pygrf
def test_gat_has_correct_width(data_files, name, expected):
    gat = open_gat(data_files[name])
    assert gat.width == expected
예제 #4
0
파일: test_gat.py 프로젝트: bmeinka/pygrf
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
예제 #5
0
파일: test_gat.py 프로젝트: bmeinka/pygrf
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
예제 #6
0
파일: test_gat.py 프로젝트: bmeinka/pygrf
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()
예제 #7
0
파일: test_gat.py 프로젝트: bmeinka/pygrf
def test_gat_is_io_object(data_files):
    gat = open_gat(data_files['a.gat'])
    assert isinstance(gat, io.IOBase)
예제 #8
0
파일: test_gat.py 프로젝트: bmeinka/pygrf
def test_open_gat_raises_gat_error(data_files, name):
    with pytest.raises(FileParseError):
        open_gat(data_files[name])
예제 #9
0
파일: test_gat.py 프로젝트: bmeinka/pygrf
def test_gat_has_correct_size(data_files, name):
    gat = open_gat(data_files[name])
    assert gat.size == (gat.width, gat.height)
예제 #10
0
파일: test_gat.py 프로젝트: bmeinka/pygrf
def test_gat_has_correct_height(data_files, name, expected):
    gat = open_gat(data_files[name])
    assert gat.height == expected