def test_kml_bbox(script_runner): ret = script_runner.run('geoextent', '-b', 'tests/testdata/kml/aasee.kml') result = ret.stdout bboxList = parse_coordinates(result) assert bboxList == pytest.approx( [7.594213, 51.942465, 7.618246, 51.957278], abs=tolerance) assert "4326" in result
def test_geojson_bbox(script_runner): ret = script_runner.run( 'geoextent', '-b', 'tests/testdata/geojson/muenster_ring_zeit.geojson') assert ret.success, "process should return success" result = ret.stdout bboxList = parse_coordinates(result) assert bboxList == pytest.approx( [7.601680, 51.948814, 7.647256, 51.974624], abs=tolerance) assert "4326" in result
def test_csv_bbox(script_runner): ret = script_runner.run('geoextent', '-b', 'tests/testdata/csv/cities_NL.csv') assert ret.success, "process should return success" result = ret.stdout bboxList = parse_coordinates(result) assert bboxList == pytest.approx([4.3175, 51.434444, 6.574722, 53.217222], abs=tolerance) assert "4326" in result
def test_netcdf_bbox(script_runner): ret = script_runner.run('geoextent', '-b', 'tests/testdata/nc/zeroes.nc') assert ret.success, "process should return success" assert ret.stderr == '', "stderr should be empty" result = ret.stdout bboxList = parse_coordinates(result) assert bboxList == pytest.approx([19.86842, -52.63157, 25.13157, 52.63157], abs=tolerance) assert "4326" in result
def test_zenodo_valid_doi_repository(script_runner): ret = script_runner.run('geoextent', '-b', '-t', 'https://doi.org/10.5281/zenodo.820562') assert ret.success, "process should return success" assert 'has no identifiable time extent' in ret.stderr result = ret.stdout bboxList = parse_coordinates(result) assert bboxList == pytest.approx([96.21146, 25.55834, 96.35495, 25.63293], abs=tolerance) assert "4326" in result
def test_gml_bbox(script_runner): ret = script_runner.run('geoextent', '-b', 'tests/testdata/gml/clc_1000_PT.gml') assert ret.success, "process should return success" assert ret.stderr == '', "stderr should be empty" result = ret.stdout bboxList = parse_coordinates(result) assert bboxList == pytest.approx( [-17.542069, 32.39669, -6.959389, 39.301139], abs=tolerance) assert "4326" in result
def test_gpkg_bbox(script_runner): ret = script_runner.run('geoextent', '-b', 'tests/testdata/geopackage/nc.gpkg') result = ret.stdout assert ret.success, "process should return success" assert ret.stderr == '', "stderr should be empty" bboxList = parse_coordinates(result) assert bboxList == pytest.approx( [-84.32383, 33.882102, -75.456585, 36.589757], abs=tolerance) assert "4326" in result
def test_geotiff_bbox(script_runner): ret = script_runner.run('geoextent', '-b', 'tests/testdata/tif/wf_100m_klas.tif') assert ret.success, "process should return success" assert ret.stderr == '', "stderr should be empty" result = ret.stdout bboxList = parse_coordinates(result) assert bboxList == pytest.approx( [5.915300, 50.310251, 9.468398, 52.530775], abs=tolerance) assert "4326" in result
def test_folder(script_runner): ret = script_runner.run('geoextent', '-b', '-t', 'tests/testdata/folders/folder_two_files') assert ret.success, "process should return success" assert ret.stderr == '', "stderr should be empty" result = ret.stdout bboxList = parse_coordinates(result) assert bboxList == pytest.approx( [2.052333, 41.317038, 7.647256, 51.974624], abs=tolerance) assert "['2018-11-14', '2019-09-11']" in result, "merge time value of folder files, is printed to console" assert "4326" in result
def test_zipfile(script_runner): folder_name = "tests/testdata/folders/folder_one_file" with tempfile.TemporaryDirectory() as tmp: zip_path = os.path.join(tmp, "zipfile.zip") create_zip(folder_name, zip_path) ret = script_runner.run('geoextent', '-b', '-t', zip_path) assert ret.success, "process should return success" result = ret.stdout bboxList = parse_coordinates(result) assert bboxList == pytest.approx( [7.601680, 51.948814, 7.647256, 51.974624], abs=tolerance) assert "['2018-11-14', '2018-11-14']" in result assert "4326" in result