@@ -21,9 +21,9 @@ def test_alter_asset_absolute_path(
21
21
assert asset .get_absolute_href () == new_href
22
22
assert os .path .exists (new_href )
23
23
if action == "move" :
24
- assert not os .path .exists (old_href )
24
+ assert not os .path .exists (old_href . replace ( "file://" , "" ) )
25
25
elif action == "copy" :
26
- assert os .path .exists (old_href )
26
+ assert os .path .exists (old_href . replace ( "file://" , "" ) )
27
27
28
28
29
29
@pytest .mark .parametrize ("action" , ["copy" , "move" ])
@@ -38,11 +38,11 @@ def test_alter_asset_relative_path(action: str, tmp_asset: pystac.Asset) -> None
38
38
assert asset .href == new_href
39
39
href = asset .get_absolute_href ()
40
40
assert href is not None
41
- assert os .path .exists (href )
41
+ assert os .path .exists (href . replace ( "file://" , "" ) )
42
42
if action == "move" :
43
- assert not os .path .exists (old_href )
43
+ assert not os .path .exists (old_href . replace ( "file://" , "" ) )
44
44
elif action == "copy" :
45
- assert os .path .exists (old_href )
45
+ assert os .path .exists (old_href . replace ( "file://" , "" ) )
46
46
47
47
48
48
@pytest .mark .parametrize ("action" , ["copy" , "move" ])
@@ -82,23 +82,23 @@ def test_delete_asset(tmp_asset: pystac.Asset) -> None:
82
82
asset = tmp_asset
83
83
href = asset .get_absolute_href ()
84
84
assert href is not None
85
- assert os .path .exists (href )
85
+ assert os .path .exists (href . replace ( "file://" , "" ) )
86
86
87
87
asset .delete ()
88
88
89
- assert not os .path .exists (href )
89
+ assert not os .path .exists (href . replace ( "file://" , "" ) )
90
90
91
91
92
92
def test_delete_asset_relative_no_owner_fails (tmp_asset : pystac .Asset ) -> None :
93
93
asset = tmp_asset
94
94
href = asset .get_absolute_href ()
95
95
assert href is not None
96
- assert os .path .exists (href )
96
+ assert os .path .exists (href . replace ( "file://" , "" ) )
97
97
98
98
asset .owner = None
99
99
100
100
with pytest .raises (ValueError , match = "Cannot delete file" ) as e :
101
101
asset .delete ()
102
102
103
103
assert asset .href in str (e .value )
104
- assert os .path .exists (href )
104
+ assert os .path .exists (href . replace ( "file://" , "" ) )
0 commit comments