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

Method test_dump_duplicates

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

Source from the content-addressed store, hash-verified

940 self.assertEqual(plistlib.loads(data), {'a': 'b'})
941
942 def test_dump_duplicates(self):
943 # Test effectiveness of saving duplicated objects
944 for x in (None, False, True, 12345, 123.45, 'abcde', 'абвгд', b'abcde',
945 datetime.datetime(2004, 10, 26, 10, 33, 33),
946 bytearray(b'abcde'), [12, 345], (12, 345), {'12': 345}):
947 with self.subTest(x=x):
948 data = plistlib.dumps([x]*1000, fmt=plistlib.FMT_BINARY)
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',

Callers

nothing calls this directly

Calls 6

lenFunction · 0.85
reprFunction · 0.85
datetimeMethod · 0.80
subTestMethod · 0.80
dumpsMethod · 0.45
assertLessMethod · 0.45

Tested by

no test coverage detected