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

Method test_compat_unpickle

Lib/test/datetimetester.py:2596–2612  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2594 self.assertTrue(isinstance(derived, SubclassDatetime))
2595
2596 def test_compat_unpickle(self):
2597 tests = [
2598 b'cdatetime\ndatetime\n('
2599 b"S'\\x07\\xdf\\x0b\\x1b\\x14;\\x01\\x00\\x10\\x00'\ntR.",
2600
2601 b'cdatetime\ndatetime\n('
2602 b'U\n\x07\xdf\x0b\x1b\x14;\x01\x00\x10\x00tR.',
2603
2604 b'\x80\x02cdatetime\ndatetime\n'
2605 b'U\n\x07\xdf\x0b\x1b\x14;\x01\x00\x10\x00\x85R.',
2606 ]
2607 args = 2015, 11, 27, 20, 59, 1, 64**2
2608 expected = self.theclass(*args)
2609 for data in tests:
2610 for loads in pickle_loads:
2611 derived = loads(data, encoding='latin1')
2612 self.assertEqual(derived, expected)
2613
2614 def test_more_compare(self):
2615 # The test_compare() inherited from TestDate covers the error cases.

Callers

nothing calls this directly

Calls 2

loadsFunction · 0.50
assertEqualMethod · 0.45

Tested by

no test coverage detected