Beispiel #1
0
def test_parsed_path_file_local(scheme):
    """A parsed path is remote"""
    assert _ParsedPath('foo.tif', None, scheme).is_local
Beispiel #2
0
def test_parsed_path_name_no_scheme():
    """A parsed path's name property is correct"""
    assert _ParsedPath('bar.tif', None, None).name == 'bar.tif'
Beispiel #3
0
def test_parsed_path_remote(scheme):
    """A parsed path is remote"""
    assert _ParsedPath('example.com/foo.tif', None, scheme).is_remote
Beispiel #4
0
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'
Beispiel #5
0
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'
Beispiel #6
0
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'
Beispiel #7
0
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'
Beispiel #8
0
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'