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):
577
577
zipfile .Path (alpharep )
578
578
with self .assertRaises (KeyError ):
579
579
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):
3033
3033
3034
3034
self .assertEqual (set (os .listdir (target )), {"directory" , "directory2" })
3035
3035
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
+
3036
3047
def tearDown (self ):
3037
3048
rmtree (TESTFN2 )
3038
3049
if os .path .exists (TESTFN ):
You can’t perform that action at this time.
0 commit comments