Home
last modified time | relevance | path

Searched refs:dumps (Results 1 – 25 of 299) sorted by relevance

12345678910>>...12

/third_party/python/Lib/test/test_json/
Dtest_enum.py38 self.assertEqual(self.dumps(enum), repr(enum.value))
39 self.assertEqual(float(self.dumps(enum)), enum)
40 self.assertEqual(self.loads(self.dumps(enum)), enum)
44 self.assertEqual(self.dumps(enum), expected)
46 self.assertEqual(float(self.dumps(enum)), enum)
47 self.assertEqual(self.loads(self.dumps(enum)), enum)
49 self.assertTrue(isnan(float(self.dumps(enum))))
50 self.assertTrue(isnan(self.loads(self.dumps(enum))))
54 self.assertEqual(self.dumps(enum), str(enum.value))
55 self.assertEqual(int(self.dumps(enum)), enum)
[all …]
Dtest_dump.py13 self.assertEqual(self.dumps({}), '{}')
18 self.json.dumps(v)
20 s = self.json.dumps(v, skipkeys=True)
26 self.assertEqual(self.dumps(
29 self.assertEqual(self.dumps(
38 self.assertEqual(self.dumps(a, default=crasher),
58 self.assertEqual(self.dumps(d, sort_keys=True), '{"1337": "true.dat"}')
74 encoded = self.dumps(l)
Dtest_unicode.py12 j = self.dumps(u)
17 j = self.dumps([u])
22 j = self.dumps(u, ensure_ascii=False)
27 j = self.dumps([u], ensure_ascii=False)
32 self.assertEqual(self.dumps(u), '"\\ud834\\udd20"')
33 self.assertEqual(self.dumps(u, ensure_ascii=False), '"\U0001d120"')
52 self.assertRaises(TypeError, self.dumps, b"hi")
53 self.assertRaises(TypeError, self.dumps, [b"hi"])
64 encoded = self.dumps(data).encode(encoding)
Dtest_recursion.py13 self.dumps(x)
22 self.dumps(x)
30 self.dumps(x)
36 self.dumps(x)
44 self.dumps(x)
84 self.dumps(l)
86 self.dumps(d)
Dtest_float.py8 self.assertEqual(float(self.dumps(num)), num)
9 self.assertEqual(self.loads(self.dumps(num)), num)
13 self.assertEqual(self.dumps(num), str(num))
14 self.assertEqual(int(self.dumps(num)), num)
22 out = self.dumps([val])
29 self.assertRaises(ValueError, self.dumps, [val], allow_nan=False)
Dtest_indent.py32 d1 = self.dumps(h)
33 d2 = self.dumps(h, indent=2, sort_keys=True, separators=(',', ': '))
34 d3 = self.dumps(h, indent='\t', sort_keys=True, separators=(',', ': '))
35 d4 = self.dumps(h, indent=2, sort_keys=True)
36 d5 = self.dumps(h, indent='\t', sort_keys=True)
53 d1 = self.dumps(h, indent=indent)
Dtest_separators.py32 d1 = self.dumps(h)
33 d2 = self.dumps(h, indent=2, sort_keys=True, separators=(' ,', ' : '))
44 self.assertRaises(TypeError, self.dumps, h, separators=(b', ', ': '))
45 self.assertRaises(TypeError, self.dumps, h, separators=(', ', b': '))
46 self.assertRaises(TypeError, self.dumps, h, separators=(b', ', b': '))
D__init__.py20 dumps = staticmethod(pyjson.dumps) variable in PyTest
28 dumps = staticmethod(cjson.dumps) variable in CTest
Dtest_default.py7 self.dumps(type, default=repr),
8 self.dumps(repr(type)))
Dtest_encode_basestring_ascii.py32 s = self.dumps(OrderedDict(items))
37 s = self.dumps(dict(items), sort_keys=True)
/third_party/python/Lib/test/
Dtest_plistlib.py461 self.assertRaises(TypeError, plistlib.dumps, pl, fmt=fmt)
476 data = plistlib.dumps(pl, fmt=fmt)
480 data2 = plistlib.dumps(pl2, fmt=fmt)
486 self.assertRaises(OverflowError, plistlib.dumps,
493 data = plistlib.dumps(bytearray(pl), fmt=fmt)
497 data2 = plistlib.dumps(pl2, fmt=fmt)
502 data = plistlib.dumps(pl)
505 data2 = plistlib.dumps(pl2)
510 self.assertEqual(plistlib.loads(plistlib.dumps(data)), data)
514 self.assertEqual(plistlib.loads(plistlib.dumps(data)), data)
[all …]
Dpickletester.py1460 s = self.dumps(x, proto)
1465 s = self.dumps(x, proto)
1470 s = self.dumps(x, proto)
1479 s = self.dumps(expected, proto)
1494 s = self.dumps(self._testdata, proto)
1505 s = self.dumps(l, proto)
1526 s = self.dumps(t, proto)
1538 s = self.dumps(t, proto)
1561 s = self.dumps(d, proto)
1582 s = self.dumps(t, proto)
[all …]
Dtest_marshal.py18 new = marshal.loads(marshal.dumps(sample, *extra))
76 s = marshal.dumps(f, 2)
80 s = marshal.dumps(f, 1)
95 self.helper(marshal.loads(marshal.dumps(s)))
107 new = marshal.loads(marshal.dumps(StopIteration))
113 new = marshal.loads(marshal.dumps(co))
120 marshal.loads(marshal.dumps(codes))
125 co1, co2 = marshal.loads(marshal.dumps((co1, co2)))
133 co = marshal.loads(marshal.dumps(co))
168 new = marshal.loads(marshal.dumps(b))
[all …]
Dtest_list.py87 d = pickle.dumps((itorig, orig), proto)
95 d = pickle.dumps((itorig, orig), proto)
104 d = pickle.dumps((itorig, orig), proto)
112 d = pickle.dumps((itorig, orig), proto)
123 d = pickle.dumps((itorig, orig), proto)
131 d = pickle.dumps((itorig, orig), proto)
140 d = pickle.dumps((itorig, orig), proto)
148 d = pickle.dumps((itorig, orig), proto)
Dtest_xmlrpc.py49 dump = xmlrpclib.dumps((alist,))
60 s = xmlrpclib.dumps((dt,))
91 s = xmlrpclib.dumps((dt,))
107 ((new_d,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((d,),
112 s = xmlrpclib.dumps((new_d,), methodresponse=True)
121 ((t2,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((t,)))
125 self.assertRaises(OverflowError, xmlrpclib.dumps, (2**99,))
128 self.assertRaises(TypeError, xmlrpclib.dumps, ({(1,2,3): 1},))
134 self.assertRaises(TypeError, xmlrpclib.dumps, (l,))
140 self.assertRaises(TypeError, xmlrpclib.dumps, (d,))
[all …]
Dtest_bool.py266 self.assertIs(marshal.loads(marshal.dumps(True)), True)
267 self.assertIs(marshal.loads(marshal.dumps(False)), False)
272 self.assertIs(pickle.loads(pickle.dumps(True, proto)), True)
273 self.assertIs(pickle.loads(pickle.dumps(False, proto)), False)
278 self.assertEqual(pickle.dumps(True, protocol=0), b"I01\n.")
279 self.assertEqual(pickle.dumps(False, protocol=0), b"I00\n.")
280 self.assertEqual(pickle.dumps(True, protocol=1), b"I01\n.")
281 self.assertEqual(pickle.dumps(False, protocol=1), b"I00\n.")
282 self.assertEqual(pickle.dumps(True, protocol=2), b'\x80\x02\x88.')
283 self.assertEqual(pickle.dumps(False, protocol=2), b'\x80\x02\x89.')
Dtest_pickle.py37 dumps = staticmethod(pickle._dumps) variable in PyPickleTests
63 def dumps(self, arg, proto=None, **kwargs): member in PyPicklerTests
84 def dumps(self, arg, protocol=None, **kwargs): member in InMemoryPickleTests
85 return pickle.dumps(arg, protocol, **kwargs)
95 def dumps(self, arg, proto=None): member in PersistentPicklerUnpicklerMixin
161 unpickler = Unpickler(io.BytesIO(self.dumps('abc', proto)))
218 from _pickle import dump, dumps, load, loads, Pickler, Unpickler
311 dump = pickle.dumps(data)
333 u = unpickler(io.BytesIO(pickle.dumps('a', 0)),
Dtest_pickletools.py10 def dumps(self, arg, proto=None, **kwargs): member in OptimizedPickleTests
11 return pickletools.optimize(pickle.dumps(arg, proto, **kwargs))
26 pickled = pickle.dumps(data, proto)
Daudit-tests.py113 payload = marshal.dumps(o)
116 assertEqual(o, marshal.loads(marshal.dumps(o)))
143 payload_1 = pickle.dumps(PicklePrint())
144 payload_2 = pickle.dumps(("a", "b", "c", 1, 2, 3))
/third_party/python/Lib/ctypes/test/
Dtest_pickling.py18 def dumps(self, item): member in PickleTest
19 return pickle.dumps(item, self.proto)
29 dst = self.loads(self.dumps(src))
41 y = self.loads(self.dumps(x))
55 self.assertRaises(ValueError, lambda: self.dumps(Y()))
67 self.assertRaises(ValueError, lambda: self.dumps(item))
70 self.dumps(c_char(b"x"))
72 self.dumps(c_wchar("x"))
/third_party/skia/infra/bots/buildstats/
Dbuildstats_web.py60 print(json.dumps(results, indent=2))
63 output.write(json.dumps(results, indent=2))
Dbuildstats_wasm.py74 print(json.dumps(results, indent=2))
77 output.write(json.dumps(results, indent=2))
Dbuildstats_cpp.py84 print(json.dumps(results, indent=2))
87 output.write(json.dumps(results, indent=2))
/third_party/python/Lib/test/test_email/
Dtest_pickleable.py34 p = pickle.dumps(header, proto)
70 p = pickle.dumps(msg, proto)
/third_party/gn/examples/ios/build/config/ios/scripts/
Dfind_app_identifier_prefix.py112 sys.stdout.write(json.dumps(substitutions))
115 output.write(json.dumps(substitutions))

12345678910>>...12