@@ -21,9 +21,9 @@ def test_alter_asset_absolute_path(
2121 assert asset .get_absolute_href () == new_href
2222 assert os .path .exists (new_href )
2323 if action == "move" :
24- assert not os .path .exists (old_href )
24+ assert not os .path .exists (old_href . replace ( "file://" , "" ) )
2525 elif action == "copy" :
26- assert os .path .exists (old_href )
26+ assert os .path .exists (old_href . replace ( "file://" , "" ) )
2727
2828
2929@pytest .mark .parametrize ("action" , ["copy" , "move" ])
@@ -38,11 +38,11 @@ def test_alter_asset_relative_path(action: str, tmp_asset: pystac.Asset) -> None
3838 assert asset .href == new_href
3939 href = asset .get_absolute_href ()
4040 assert href is not None
41- assert os .path .exists (href )
41+ assert os .path .exists (href . replace ( "file://" , "" ) )
4242 if action == "move" :
43- assert not os .path .exists (old_href )
43+ assert not os .path .exists (old_href . replace ( "file://" , "" ) )
4444 elif action == "copy" :
45- assert os .path .exists (old_href )
45+ assert os .path .exists (old_href . replace ( "file://" , "" ) )
4646
4747
4848@pytest .mark .parametrize ("action" , ["copy" , "move" ])
@@ -82,23 +82,23 @@ def test_delete_asset(tmp_asset: pystac.Asset) -> None:
8282 asset = tmp_asset
8383 href = asset .get_absolute_href ()
8484 assert href is not None
85- assert os .path .exists (href )
85+ assert os .path .exists (href . replace ( "file://" , "" ) )
8686
8787 asset .delete ()
8888
89- assert not os .path .exists (href )
89+ assert not os .path .exists (href . replace ( "file://" , "" ) )
9090
9191
9292def test_delete_asset_relative_no_owner_fails (tmp_asset : pystac .Asset ) -> None :
9393 asset = tmp_asset
9494 href = asset .get_absolute_href ()
9595 assert href is not None
96- assert os .path .exists (href )
96+ assert os .path .exists (href . replace ( "file://" , "" ) )
9797
9898 asset .owner = None
9999
100100 with pytest .raises (ValueError , match = "Cannot delete file" ) as e :
101101 asset .delete ()
102102
103103 assert asset .href in str (e .value )
104- assert os .path .exists (href )
104+ assert os .path .exists (href . replace ( "file://" , "" ) )
0 commit comments