mirror of
https://github.com/Leseratte10/acsm-calibre-plugin
synced 2026-09-10 03:02:00 -04:00
Fix test
This commit is contained in:
+13
-2
@@ -432,11 +432,19 @@ class TestPluginInterface(unittest.TestCase):
|
||||
def forcefail(self):
|
||||
self.assertEqual(1, 2, "force fail")
|
||||
|
||||
@unittest.expectedFailure
|
||||
@freeze_time("1970-04-01 00:00:00.000000")
|
||||
@unittest.skipIf(sys.platform.startswith("win"), "Does not work on Windows due to file permissions.")
|
||||
@unittest.skipIf(sys.version_info < (3, 8, 0), "Doesn't support strict_timestamps")
|
||||
@unittest.skipIf(sys.version_info >= (3, 14, 0), "This is currently buggy, see cpython bug #152445")
|
||||
def test_addFileToZipIn1970(self):
|
||||
'''Check if ZIP file writing works in 1970'''
|
||||
|
||||
source_date_epoch_old = None
|
||||
|
||||
if 'SOURCE_DATE_EPOCH' in os.environ:
|
||||
source_date_epoch_old = os.environ['SOURCE_DATE_EPOCH']
|
||||
|
||||
os.environ['SOURCE_DATE_EPOCH'] = '1'
|
||||
|
||||
import zipfile, tempfile, struct
|
||||
try:
|
||||
tf = tempfile.NamedTemporaryFile(suffix='.zip')
|
||||
@@ -445,6 +453,9 @@ class TestPluginInterface(unittest.TestCase):
|
||||
zf.close()
|
||||
except struct.error:
|
||||
self.fail("Failed to add file to ZIP archive")
|
||||
finally:
|
||||
if source_date_epoch_old is not None:
|
||||
os.environ['SOURCE_DATE_EPOCH'] = source_date_epoch_old
|
||||
|
||||
|
||||
def test_loanReturnFulfillmentID(self):
|
||||
|
||||
Reference in New Issue
Block a user