Example #1
0
def enable_mock():
    RasterData.register("mock", MockReader)

    yield

    if "mock" in RasterData._concrete_data_types:
        del RasterData._concrete_data_types["mock"]
Example #2
0
def single():
    RasterData.register("mock", MockReader)

    yield RasterData("single.mock")

    if "mock" in RasterData._concrete_data_types:
        del RasterData._concrete_data_types["mock"]
Example #3
0
def rdc_one():
    RasterData.register("mock", MockReader)

    yield RasterDataCollection(["rect1.mock"])

    if "mock" in RasterData._concrete_data_types:
        del RasterData._concrete_data_types["mock"]
Example #4
0
def rect():
    RasterData.register("mock", MockReader)

    yield RasterData("rect.mock")

    if "mock" in RasterData._concrete_data_types:
        del RasterData._concrete_data_types["mock"]
Example #5
0
def coords():
    RasterData.register("mock", MockReader)

    yield RasterData("coords.mock")

    if "mock" in RasterData._concrete_data_types:
        del RasterData._concrete_data_types["mock"]
Example #6
0
def rdc_single():
    RasterData.register("mock", MockReader)

    yield RasterDataCollection([
        "single1.mock", "single2.mock", "single3.mock"])

    if "mock" in RasterData._concrete_data_types:
        del RasterData._concrete_data_types["mock"]
Example #7
0
def enable_mock():
    RasterData.register("mock", MockReader)
    RasterData._default_schema = 'mock'

    yield

    if "mock" in RasterData._concrete_schema:
        del RasterData._concrete_schema["mock"]
    RasterData._default_schema = 'file'
Example #8
0
def rdc_one():
    RasterData.register("mock", MockReader)
    RasterData._default_schema = 'mock'

    yield RasterDataCollection(["rect1.mock"])

    if "mock" in RasterData._concrete_schema:
        del RasterData._concrete_schema["mock"]
    RasterData._default_schema = 'file'
Example #9
0
def rasterdata_list():
    RasterData.register("mock", MockReader)
    RasterData._default_schema = 'mock'
    yield RasterDataCollection(
        ['test_data1.tif', 'test_data2.tif', 'test_data3.tif'])

    if "mock" in RasterData._concrete_schema:
        del RasterData._concrete_schema["mock"]
    RasterData._default_schema = 'file'
Example #10
0
def rect():
    RasterData.register("mock", MockReader)
    RasterData._default_schema = 'mock'

    yield RasterData("rect.mock")

    if "mock" in RasterData._concrete_schema:
        del RasterData._concrete_schema["mock"]
    RasterData._default_schema = 'file'
Example #11
0
def test_raster_data_is_not_valid_no_class(tmpdir):
    p = tmpdir.mkdir("data").join("test.foo")
    p.write("BOGUS DATA")
    assert not RasterData.is_valid(str(p))
Example #12
0
def test_raster_data_is_not_valid_no_path(tmpdir):
    assert not RasterData.is_valid("/some/bogus/path.tif")
Example #13
0
def test_raster_data_is_valid(tmpdir):
    p = tmpdir.mkdir("data").join("test.tif")
    p.write("BOGUS DATA")
    assert RasterData.is_valid(str(p))
Example #14
0
def test_bad_filetype():
    with pytest.raises(NotImplementedError):
        RasterData("foo.bar")