Commit aa90387 1 parent f7f22cc commit aa90387 Copy full SHA for aa90387
File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -794,6 +794,19 @@ def test_local(self) -> None:
794
794
with self .root_uri .as_local () as local_uri :
795
795
pass
796
796
797
+ if not src .isLocal :
798
+ # as_local tmpdir can not be a remote resource.
799
+ with self .assertRaises (ValueError ):
800
+ with src .as_local (tmpdir = self .root_uri ) as local_uri :
801
+ pass
802
+
803
+ # tmpdir is ignored for local file.
804
+ with tempfile .TemporaryDirectory () as tmpdir :
805
+ temp_dir = ResourcePath (tmpdir , forceDirectory = True )
806
+ with src .as_local (tmpdir = temp_dir ) as local_uri :
807
+ self .assertEqual (local_uri .dirname (), temp_dir )
808
+ self .assertTrue (local_uri .exists ())
809
+
797
810
def test_local_mtransfer (self ) -> None :
798
811
"""Check that bulk transfer to/from local works."""
799
812
# Create remote resources
You can’t perform that action at this time.
0 commit comments