Lines Matching refs:fmt
411 def _create(self, fmt=None): argument
459 for fmt in ALL_FORMATS:
460 with self.subTest(fmt=fmt):
461 self.assertRaises(TypeError, plistlib.dumps, pl, fmt=fmt)
474 for fmt in ALL_FORMATS:
475 with self.subTest(pl=pl, fmt=fmt):
476 data = plistlib.dumps(pl, fmt=fmt)
480 data2 = plistlib.dumps(pl2, fmt=fmt)
483 for fmt in ALL_FORMATS:
485 with self.subTest(pl=pl, fmt=fmt):
487 pl, fmt=fmt)
491 for fmt in ALL_FORMATS:
492 with self.subTest(pl=pl, fmt=fmt):
493 data = plistlib.dumps(bytearray(pl), fmt=fmt)
497 data2 = plistlib.dumps(pl2, fmt=fmt)
522 self.assertEqual(plistlib.loads(plistlib.dumps(data, fmt=plistlib.FMT_BINARY)), data)
531 … self.assertEqual(plistlib.loads(plistlib.dumps(dict_data, fmt=plistlib.FMT_BINARY)), dict_data)
560 for fmt in ALL_FORMATS:
561 with self.subTest(fmt=fmt):
562 pl = plistlib.loads(TESTDATA[fmt])
563 data = plistlib.dumps(pl, fmt=fmt)
564 self.assertEqual(data, TESTDATA[fmt],
570 for fmt in ALL_FORMATS:
571 with self.subTest(fmt=fmt):
572 pl = self._create(fmt=fmt)
573 pl2 = plistlib.loads(TESTDATA[fmt], fmt=fmt)
576 pl2 = plistlib.loads(TESTDATA[fmt])
581 for fmt in ALL_FORMATS:
582 with self.subTest(fmt=fmt):
584 pl = self._create(fmt=fmt)
585 plistlib.dump(pl, b, fmt=fmt)
586 pl2 = plistlib.load(BytesIO(b.getvalue()), fmt=fmt)
597 for fmt in ALL_FORMATS:
599 with self.subTest(fmt=fmt, sort_keys=sort_keys):
602 plistlib.dump(pl, b, fmt=fmt, sort_keys=sort_keys)
618 for fmt in ALL_FORMATS:
620 with self.subTest(fmt=fmt, sort_keys=sort_keys):
621 data = plistlib.dumps(pl, fmt=fmt, sort_keys=sort_keys)
633 for fmt in ALL_FORMATS:
634 with self.subTest(fmt=fmt):
635 self.assertRaises(TypeError, plistlib.dumps, pl, fmt=fmt)
638 self.assertRaises(TypeError, plistlib.dump, pl, b, fmt=fmt)
646 for fmt in ALL_FORMATS:
647 with self.subTest(fmt=fmt):
649 pl, fmt=fmt, skipkeys=True, sort_keys=False)
656 pl, fp, fmt=fmt, skipkeys=True, sort_keys=False)
668 for fmt in ALL_FORMATS:
669 with self.subTest(fmt=fmt):
670 data = plistlib.dumps(pl, fmt=fmt)
677 if fmt != plistlib.FMT_BINARY:
687 for fmt in ALL_FORMATS:
688 with self.subTest(fmt=fmt):
689 data = plistlib.dumps(pl, fmt=fmt)
705 for fmt in ALL_FORMATS:
706 with self.subTest(fmt=fmt):
707 data = plistlib.dumps(pl, fmt=fmt)
722 data = plistlib.dumps(testString, fmt=plistlib.FMT_XML)
727 plistlib.dumps(testString, fmt=plistlib.FMT_XML)
728 plistlib.dumps(testString, fmt=plistlib.FMT_BINARY)
732 for fmt in ALL_FORMATS:
733 with self.subTest(fmt=fmt):
734 data = plistlib.dumps(pl, fmt=fmt)
738 for fmt in ALL_FORMATS:
739 with self.subTest(fmt=fmt):
741 plistlib.dumps('\ud8ff', fmt=fmt)
743 plistlib.dumps('\udcff', fmt=fmt)
746 for fmt in ALL_FORMATS:
747 with self.subTest(fmt=fmt):
750 result1 = plistlib.loads(plistlib.dumps(test1, fmt=fmt))
751 result2 = plistlib.loads(plistlib.dumps(test2, fmt=fmt))
806 pl = self._create(fmt=plistlib.FMT_XML)
815 plistlib.dumps({}, fmt="blah")
825 plistlib.dumps(neg_uid, fmt=plistlib.FMT_BINARY)
831 plistlib.dumps(huge_uid, fmt=plistlib.FMT_BINARY)
836 plistlib.loads(XML_PLIST_WITH_ENTITY, fmt=plistlib.FMT_XML)
854 return plistlib.loads(b''.join(data), fmt=plistlib.FMT_BINARY)
874 data = plistlib.dumps([x]*1000, fmt=plistlib.FMT_BINARY)
882 data = plistlib.dumps([x]*2, fmt=plistlib.FMT_BINARY)
894 b = plistlib.loads(plistlib.dumps(a, fmt=plistlib.FMT_BINARY))
899 b = plistlib.loads(plistlib.dumps(a, fmt=plistlib.FMT_BINARY))
904 b = plistlib.loads(plistlib.dumps(a, fmt=plistlib.FMT_BINARY))
927 data = plistlib.dumps(d, fmt=plistlib.FMT_BINARY)
960 plistlib.loads(b'bplist00' + data, fmt=plistlib.FMT_BINARY)