MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_identity

Method test_identity

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

Source from the content-addressed store, hash-verified

949 self.assertLess(len(data), 1100, repr(data))
950
951 def test_identity(self):
952 for x in (None, False, True, 12345, 123.45, 'abcde', b'abcde',
953 datetime.datetime(2004, 10, 26, 10, 33, 33),
954 bytearray(b'abcde'), [12, 345], (12, 345), {'12': 345}):
955 with self.subTest(x=x):
956 data = plistlib.dumps([x]*2, fmt=plistlib.FMT_BINARY)
957 a, b = plistlib.loads(data)
958 if isinstance(x, tuple):
959 x = list(x)
960 self.assertEqual(a, x)
961 self.assertEqual(b, x)
962 self.assertIs(a, b)
963
964 def test_cycles(self):
965 # recursive list

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected