def test_parsed_path_file_local(scheme): """A parsed path is remote""" assert _ParsedPath('foo.tif', None, scheme).is_local
def test_parsed_path_name_no_scheme(): """A parsed path's name property is correct""" assert _ParsedPath('bar.tif', None, None).name == 'bar.tif'
def test_parsed_path_remote(scheme): """A parsed path is remote""" assert _ParsedPath('example.com/foo.tif', None, scheme).is_remote
def test_parsed_path_name_no_archive(): """A parsed path's name property is correct""" assert _ParsedPath('bar.tif', None, 'file').name == 'file://bar.tif'
def test_parsed_path_name(): """A parsed path's name property is correct""" assert _ParsedPath('bar.tif', 'foo.zip', 'zip').name == 'zip://foo.zip!bar.tif'
def test_vsi_path_curl(): """Correctly make and ordinary file path from a https path""" assert _vsi_path(_ParsedPath('example.com/foo.tif', None, 'https')) == '/vsicurl/https://example.com/foo.tif'
def test_vsi_path_file(): """Correctly make and ordinary file path from a file path""" assert _vsi_path(_ParsedPath('foo.tif', None, 'file')) == 'foo.tif'
def test_path_as_vsi_scheme(): """Correctly make a vsi path""" assert _ParsedPath('/foo.tif', 'tests/data/files.zip', 'zip').as_vsi() == '/vsizip/tests/data/files.zip/foo.tif'