Skip to content

Commit c363f56

Browse files
committed
test ok
1 parent a11dcf7 commit c363f56

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/test/test_zipfile/test_core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,8 @@ def test_write_with_source_date_epoch(self):
17881788

17891789
with zipfile.ZipFile(TESTFN, "r") as zf:
17901790
zip_info = zf.getinfo("test_source_date_epoch.txt")
1791-
self.assertEqual(zip_info.date_time, time.gmtime(int(os.environ['SOURCE_DATE_EPOCH']))[:6])
1791+
get_time = time.gmtime(int(os.environ['SOURCE_DATE_EPOCH']))[:6]
1792+
self.assertAlmostEqual(zip_info.date_time, get_time, delta=1)
17921793

17931794
def test_write_without_source_date_epoch(self):
17941795
if 'SOURCE_DATE_EPOCH' in os.environ:
@@ -1799,7 +1800,7 @@ def test_write_without_source_date_epoch(self):
17991800

18001801
with zipfile.ZipFile(TESTFN, "r") as zf:
18011802
zip_info = zf.getinfo("test_no_source_date_epoch.txt")
1802-
self.assertNotEqual(zip_info.date_time, time.gmtime()[:6])
1803+
self.assertEqual(zip_info.date_time, time.gmtime()[:6])
18031804

18041805
def test_close(self):
18051806
"""Check that the zipfile is closed after the 'with' block."""

0 commit comments

Comments
 (0)