MCPcopy Index your code
hub / github.com/python/cpython / test_large_timestamp

Method test_large_timestamp

Lib/test/test_plistlib.py:1070–1077  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1068 self.assertEqual(result, 'seed')
1069
1070 def test_large_timestamp(self):
1071 # Issue #26709: 32-bit timestamp out of range
1072 for ts in -2**31-1, 2**31:
1073 with self.subTest(ts=ts):
1074 d = (datetime.datetime(1970, 1, 1, 0, 0) +
1075 datetime.timedelta(seconds=ts))
1076 data = plistlib.dumps(d, fmt=plistlib.FMT_BINARY)
1077 self.assertEqual(plistlib.loads(data), d)
1078
1079 def test_load_singletons(self):
1080 self.assertIs(self.decode(b'\x00'), None)

Callers

nothing calls this directly

Calls 5

datetimeMethod · 0.80
subTestMethod · 0.45
dumpsMethod · 0.45
assertEqualMethod · 0.45
loadsMethod · 0.45

Tested by

no test coverage detected