@@ -101,7 +101,7 @@ def zipfile_ondisk(self, alpharep):
101101 def test_iterdir_and_types (self , alpharep ):
102102 root = zipfile .Path (alpharep )
103103 assert root .is_dir ()
104- a , k , b , g , j = root .iterdir ()
104+ a , n , b , g , j = root .iterdir ()
105105 assert a .is_file ()
106106 assert b .is_dir ()
107107 assert g .is_dir ()
@@ -121,7 +121,7 @@ def test_is_file_missing(self, alpharep):
121121 @pass_alpharep
122122 def test_iterdir_on_file (self , alpharep ):
123123 root = zipfile .Path (alpharep )
124- a , k , b , g , j = root .iterdir ()
124+ a , n , b , g , j = root .iterdir ()
125125 with self .assertRaises (ValueError ):
126126 a .iterdir ()
127127
@@ -136,7 +136,7 @@ def test_subdir_is_dir(self, alpharep):
136136 @pass_alpharep
137137 def test_open (self , alpharep ):
138138 root = zipfile .Path (alpharep )
139- a , k , b , g , j = root .iterdir ()
139+ a , n , b , g , j = root .iterdir ()
140140 with a .open (encoding = "utf-8" ) as strm :
141141 data = strm .read ()
142142 self .assertEqual (data , "content of a" )
@@ -240,7 +240,7 @@ def test_open_missing_directory(self, alpharep):
240240 @pass_alpharep
241241 def test_read (self , alpharep ):
242242 root = zipfile .Path (alpharep )
243- a , k , b , g , j = root .iterdir ()
243+ a , n , b , g , j = root .iterdir ()
244244 assert a .read_text (encoding = "utf-8" ) == "content of a"
245245 # Also check positional encoding arg (gh-101144).
246246 assert a .read_text ("utf-8" ) == "content of a"
@@ -306,7 +306,7 @@ def test_mutability(self, alpharep):
306306 reflect that change.
307307 """
308308 root = zipfile .Path (alpharep )
309- a , k , b , g , j = root .iterdir ()
309+ a , n , b , g , j = root .iterdir ()
310310 alpharep .writestr ('foo.txt' , 'foo' )
311311 alpharep .writestr ('bar/baz.txt' , 'baz' )
312312 assert any (child .name == 'foo.txt' for child in root .iterdir ())
@@ -475,6 +475,18 @@ def test_glob_recursive(self, alpharep):
475475
476476 assert list (root .glob ("**/*.txt" )) == list (root .rglob ("*.txt" ))
477477
478+ @pass_alpharep
479+ def test_glob_dirs (self , alpharep ):
480+ root = zipfile .Path (alpharep )
481+ assert list (root .glob ('b' )) == [zipfile .Path (alpharep , "b/" )]
482+ assert list (root .glob ('b*' )) == [zipfile .Path (alpharep , "b/" )]
483+
484+ @pass_alpharep
485+ def test_glob_subdir (self , alpharep ):
486+ root = zipfile .Path (alpharep )
487+ assert list (root .glob ('g/h' )) == [zipfile .Path (alpharep , "g/h/" )]
488+ assert list (root .glob ('g*/h*' )) == [zipfile .Path (alpharep , "g/h/" )]
489+
478490 @pass_alpharep
479491 def test_glob_subdirs (self , alpharep ):
480492 root = zipfile .Path (alpharep )
@@ -594,3 +606,10 @@ def test_malformed_paths(self):
594606 'two-slash.txt' ,
595607 'parent.txt' ,
596608 ]
609+
610+ @pass_alpharep
611+ def test_interface (self , alpharep ):
612+ from importlib .resources .abc import Traversable
613+
614+ zf = zipfile .Path (alpharep )
615+ assert isinstance (zf , Traversable )
0 commit comments