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

Method test_identity

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

Source from the content-addressed store, hash-verified

1024 self.assertLess(len(data), 1100, repr(data))
1025
1026 def test_identity(self):
1027 for x in (None, False, True, 12345, 123.45, 'abcde', b'abcde',
1028 datetime.datetime(2004, 10, 26, 10, 33, 33),
1029 bytearray(b'abcde'), [12, 345], (12, 345), {'12': 345}):
1030 with self.subTest(x=x):
1031 data = plistlib.dumps([x]*2, fmt=plistlib.FMT_BINARY)
1032 a, b = plistlib.loads(data)
1033 if isinstance(x, tuple):
1034 x = list(x)
1035 self.assertEqual(a, x)
1036 self.assertEqual(b, x)
1037 self.assertIs(a, b)
1038
1039 def test_cycles(self):
1040 # recursive list

Callers

nothing calls this directly

Calls 7

listClass · 0.85
datetimeMethod · 0.80
subTestMethod · 0.45
dumpsMethod · 0.45
loadsMethod · 0.45
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected