From 371daa2d06cda595ff462335e91627aa22c83dec Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Mon, 30 Sep 2019 14:31:47 -0600 Subject: [PATCH] Revert changes accidentally made to path parsing --- rasterio/path.py | 5 +---- tests/test_mask_creation.py | 2 +- tests/test_path.py | 7 ------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/rasterio/path.py b/rasterio/path.py index fa6ce012..851d9d6d 100644 --- a/rasterio/path.py +++ b/rasterio/path.py @@ -133,12 +133,9 @@ def parse_path(path): else: parts = urlparse(path) - if not parts.scheme: - return UnparsedPath(path) - # if the scheme is not one of Rasterio's supported schemes, we # return an UnparsedPath. - elif parts.scheme and not all(p in SCHEMES for p in parts.scheme.split('+')): + if parts.scheme and not all(p in SCHEMES for p in parts.scheme.split('+')): return UnparsedPath(path) else: diff --git a/tests/test_mask_creation.py b/tests/test_mask_creation.py index 71841b24..af68df3f 100644 --- a/tests/test_mask_creation.py +++ b/tests/test_mask_creation.py @@ -74,7 +74,7 @@ def test_create_mask_windowed_internal(data): with rasterio.open(str(data.join('RGB.byte.tif')), 'r+') as dst: for ij, window in dst.block_windows(): blue = dst.read(1, window=window, masked=False) - mask = 255 * (blue == 0).astype('uint8') + mask = (blue != 0) dst.write_mask(mask, window=window) diff --git a/tests/test_path.py b/tests/test_path.py index b60e1b41..91fe10e5 100644 --- a/tests/test_path.py +++ b/tests/test_path.py @@ -67,7 +67,6 @@ def test_parse_path_file_scheme(): def test_parse_path_file(): """Correctly parse an ordinary filesystem path""" parsed = parse_path('/foo.tif') - assert isinstance(parsed, UnparsedPath) assert parsed.path == '/foo.tif' @@ -165,9 +164,3 @@ def test_vsi_path_zip_plus_https(): """A zip+https:// URLs vsi path is correct (see #1151)""" url = 'zip+https://example.com/foo.zip!bar.tif' assert vsi_path(parse_path(url)) == '/vsizip/vsicurl/https://example.com/foo.zip/bar.tif' - - -def test_sentinel2_l1c(): - """A Sentinel 2 L1C identifier is not parsed""" - path = "SENTINEL2_L1C:S2A_OPER_MTD_SAFL1C_PDMC_20150818T101440_R022_V20150813T102406_20150813T102406.xml:10m:EPSG_32632" - assert isinstance(parse_path(path), UnparsedPath)