@@ -1836,24 +1836,22 @@ def test_write_unicode_filenames(self):
1836
1836
1837
1837
def test_write_with_source_date_epoch (self ):
1838
1838
os .environ ['SOURCE_DATE_EPOCH' ] = "1727268221"
1839
- data = "Testing SOURCE_DATE_EPOCH"
1840
1839
1841
- with zipfile .ZipFile (self . TESTFN , "w" ) as zf :
1842
- zf .writestr ("test_source_date_epoch.txt" , data )
1840
+ with zipfile .ZipFile (TESTFN , "w" ) as zf :
1841
+ zf .writestr ("test_source_date_epoch.txt" , "Testing SOURCE_DATE_EPOCH" )
1843
1842
1844
- with zipfile .ZipFile (self . TESTFN , "r" ) as zf :
1843
+ with zipfile .ZipFile (TESTFN , "r" ) as zf :
1845
1844
zip_info = zf .getinfo ("test_source_date_epoch.txt" )
1846
1845
self .assertEqual (zip_info .date_time , time .gmtime (int (os .environ ['SOURCE_DATE_EPOCH' ]))[:6 ])
1847
1846
1848
1847
def test_write_without_source_date_epoch (self ):
1849
1848
if 'SOURCE_DATE_EPOCH' in os .environ :
1850
1849
del os .environ ['SOURCE_DATE_EPOCH' ]
1851
- data = "Testing without SOURCE_DATE_EPOCH"
1852
1850
1853
- with zipfile .ZipFile (self . TESTFN , "w" ) as zf :
1854
- zf .writestr ("test_no_source_date_epoch.txt" , data )
1851
+ with zipfile .ZipFile (TESTFN , "w" ) as zf :
1852
+ zf .writestr ("test_no_source_date_epoch.txt" , "Testing without SOURCE_DATE_EPOCH" )
1855
1853
1856
- with zipfile .ZipFile (self . TESTFN , "r" ) as zf :
1854
+ with zipfile .ZipFile (TESTFN , "r" ) as zf :
1857
1855
zip_info = zf .getinfo ("test_no_source_date_epoch.txt" )
1858
1856
current_time = time .gmtime ()[:6 ]
1859
1857
self .assertNotEqual (zip_info .date_time , current_time )
0 commit comments