File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed
Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -577,15 +577,3 @@ def test_getinfo_missing(self, alpharep):
577577 zipfile .Path (alpharep )
578578 with self .assertRaises (KeyError ):
579579 alpharep .getinfo ('does-not-exist' )
580-
581- def test_root_folder_in_zipfile (self ):
582- """
583- gh-112795: Some tools or self constructed codes will add '/' folder to
584- the zip file, this is a strange behavior, but we should support it.
585- """
586- in_memory_file = io .BytesIO ()
587- zf = zipfile .ZipFile (in_memory_file , "w" )
588- zf .mkdir ('/' )
589- zf .writestr ('./a.txt' , 'aaa' )
590- tmpdir = pathlib .Path (self .fixtures .enter_context (temp_dir ()))
591- zf .extractall (tmpdir )
Original file line number Diff line number Diff line change @@ -3033,6 +3033,17 @@ def test_create_directory_with_write(self):
30333033
30343034 self .assertEqual (set (os .listdir (target )), {"directory" , "directory2" })
30353035
3036+ def test_root_folder_in_zipfile (self ):
3037+ """
3038+ gh-112795: Some tools or self constructed codes will add '/' folder to
3039+ the zip file, this is a strange behavior, but we should support it.
3040+ """
3041+ in_memory_file = io .BytesIO ()
3042+ zf = zipfile .ZipFile (in_memory_file , "w" )
3043+ zf .mkdir ('/' )
3044+ zf .writestr ('./a.txt' , 'aaa' )
3045+ zf .extractall (TESTFN2 )
3046+
30363047 def tearDown (self ):
30373048 rmtree (TESTFN2 )
30383049 if os .path .exists (TESTFN ):
You can’t perform that action at this time.
0 commit comments