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

Method test_compat_unpickle

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

Source from the content-addressed store, hash-verified

1730 self.assertEqual(orig.__reduce__(), orig.__reduce_ex__(2))
1731
1732 def test_compat_unpickle(self):
1733 tests = [
1734 b"cdatetime\ndate\n(S'\\x07\\xdf\\x0b\\x1b'\ntR.",
1735 b'cdatetime\ndate\n(U\x04\x07\xdf\x0b\x1btR.',
1736 b'\x80\x02cdatetime\ndate\nU\x04\x07\xdf\x0b\x1b\x85R.',
1737 ]
1738 args = 2015, 11, 27
1739 expected = self.theclass(*args)
1740 for data in tests:
1741 for loads in pickle_loads:
1742 derived = loads(data, encoding='latin1')
1743 self.assertEqual(derived, expected)
1744
1745 def test_compare(self):
1746 t1 = self.theclass(2, 3, 4)

Callers

nothing calls this directly

Calls 2

loadsFunction · 0.50
assertEqualMethod · 0.45

Tested by

no test coverage detected