Home
last modified time | relevance | path

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

12345678910>>...22

/external/python/cpython3/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_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_dump.py13 self.assertEqual(self.dumps({}), '{}')
16 self.assertEqual(self.dumps(
19 self.assertEqual(self.dumps(
28 self.assertEqual(self.dumps(a, default=crasher),
48 self.assertEqual(self.dumps(d, sort_keys=True), '{"1337": "true.dat"}')
64 encoded = self.dumps(l)
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': '))
/external/fonttools/Tests/misc/
Dplistlib_test.py121 plistlib.dumps(pl)
141 data = plistlib.dumps(pl)
145 data2 = plistlib.dumps(pl2)
154 plistlib.dumps(pl)
161 data = plistlib.dumps(array)
165 data2 = plistlib.dumps(pl2, use_builtin_types=use_builtin_types)
180 data = plistlib.dumps(pl, use_builtin_types=use_builtin_types)
184 data2 = plistlib.dumps(pl2, use_builtin_types=use_builtin_types)
190 data = plistlib.dumps(pl, use_builtin_types=False)
198 assert plistlib.loads(plistlib.dumps(data)) == data
[all …]
/external/python/cpython2/Lib/json/tests/
Dtest_float.py9 self.assertEqual(float(self.dumps(num)), num)
10 self.assertEqual(self.loads(self.dumps(num)), num)
11 self.assertEqual(self.loads(unicode(self.dumps(num))), num)
15 self.assertEqual(self.dumps(num), str(num))
16 self.assertEqual(int(self.dumps(num)), num)
17 self.assertEqual(self.loads(self.dumps(num)), num)
18 self.assertEqual(self.loads(unicode(self.dumps(num))), num)
26 out = self.dumps([val])
33 self.assertRaises(ValueError, self.dumps, [val], allow_nan=False)
44 self.assertEqual(self.loads(self.dumps(val)), val)
Dtest_check_circular.py11 self.assertRaises(ValueError, self.dumps, dct)
16 self.assertRaises(ValueError, self.dumps, lst)
22 self.assertRaises(ValueError, self.dumps, dct2)
25 self.dumps([set()], default=default_iterable)
26 self.assertRaises(TypeError, self.dumps, [set()])
29 self.dumps([set()], default=default_iterable, check_circular=False)
30 self.assertRaises(TypeError, self.dumps, [set()], check_circular=False)
Dtest_recursion.py13 self.dumps(x)
22 self.dumps(x)
30 self.dumps(x)
36 self.dumps(x)
44 self.dumps(x)
92 self.dumps(l)
94 self.dumps(d)
Dtest_unicode.py17 ju = self.dumps(u, encoding='utf-8')
18 js = self.dumps(s, encoding='utf-8')
23 j = self.dumps(u)
28 j = self.dumps([u])
33 j = self.dumps(u, ensure_ascii=False)
38 j = self.dumps([u], ensure_ascii=False)
43 self.assertEqual(self.dumps(u), '"\\ud834\\udd20"')
44 self.assertEqual(self.dumps(u, ensure_ascii=False), u'"\U0001d120"')
/external/python/cpython3/Lib/test/
Dtest_plistlib.py152 self.assertRaises(TypeError, plistlib.dumps, pl, fmt=fmt)
159 data = plistlib.dumps(pl, fmt=fmt)
163 data2 = plistlib.dumps(pl2, fmt=fmt)
169 self.assertRaises(OverflowError, plistlib.dumps,
176 data = plistlib.dumps(bytearray(pl), fmt=fmt)
180 data2 = plistlib.dumps(pl2, fmt=fmt)
185 data = plistlib.dumps(pl)
188 data2 = plistlib.dumps(pl2)
193 self.assertEqual(plistlib.loads(plistlib.dumps(data)), data)
197 self.assertEqual(plistlib.loads(plistlib.dumps(data)), data)
[all …]
Dtest_marshal.py17 new = marshal.loads(marshal.dumps(sample, *extra))
75 s = marshal.dumps(f, 2)
79 s = marshal.dumps(f, 1)
94 self.helper(marshal.loads(marshal.dumps(s)))
106 new = marshal.loads(marshal.dumps(StopIteration))
112 new = marshal.loads(marshal.dumps(co))
119 marshal.loads(marshal.dumps(codes))
124 co1, co2 = marshal.loads(marshal.dumps((co1, co2)))
132 co = marshal.loads(marshal.dumps(co))
165 obj2 = marshal.loads(marshal.dumps(obj))
[all …]
Dpickletester.py1259 s = self.dumps(x, proto)
1264 s = self.dumps(x, proto)
1269 s = self.dumps(x, proto)
1278 s = self.dumps(expected, proto)
1293 s = self.dumps(self._testdata, proto)
1303 s = self.dumps(l, proto)
1313 s = self.dumps(t, proto)
1325 s = self.dumps(d, proto)
1336 s = self.dumps(d, proto)
1348 s = self.dumps(y, proto)
[all …]
Dtest_list.py86 d = pickle.dumps((itorig, orig), proto)
94 d = pickle.dumps((itorig, orig), proto)
103 d = pickle.dumps((itorig, orig), proto)
111 d = pickle.dumps((itorig, orig), proto)
122 d = pickle.dumps((itorig, orig), proto)
130 d = pickle.dumps((itorig, orig), proto)
139 d = pickle.dumps((itorig, orig), proto)
147 d = pickle.dumps((itorig, orig), proto)
/external/python/cpython2/Lib/test/
Dtest_marshal.py20 s = marshal.dumps(expected)
55 new = marshal.loads(marshal.dumps(b))
71 s = marshal.dumps(f)
80 s = marshal.dumps(f, 2)
84 s = marshal.dumps(f, 1)
93 s = marshal.dumps(f)
97 s = marshal.dumps(f, 1)
114 new = marshal.loads(marshal.dumps(s))
125 new = marshal.loads(marshal.dumps(s))
139 new = marshal.loads(marshal.dumps(b))
[all …]
Dpickletester.py875 s = self.dumps(x, proto)
880 s = self.dumps(x, proto)
885 s = self.dumps(x, proto)
894 s = self.dumps(expected, proto)
908 s = self.dumps(self._testdata, proto)
918 s = self.dumps(l, proto)
928 s = self.dumps(t, proto)
940 s = self.dumps(d, proto)
951 s = self.dumps(d, proto)
961 s = self.dumps(y, 2)
[all …]
Dtest_bool.py303 self.assertIs(marshal.loads(marshal.dumps(True)), True)
304 self.assertIs(marshal.loads(marshal.dumps(False)), False)
309 self.assertIs(pickle.loads(pickle.dumps(True, proto)), True)
310 self.assertIs(pickle.loads(pickle.dumps(False, proto)), False)
315 self.assertIs(cPickle.loads(cPickle.dumps(True, proto)), True)
316 self.assertIs(cPickle.loads(cPickle.dumps(False, proto)), False)
321 self.assertIs(pickle.loads(cPickle.dumps(True, proto)), True)
322 self.assertIs(pickle.loads(cPickle.dumps(False, proto)), False)
323 self.assertIs(cPickle.loads(pickle.dumps(True, proto)), True)
324 self.assertIs(cPickle.loads(pickle.dumps(False, proto)), False)
[all …]
Dtest_cpickle.py49 self.dumps = cPickle.dumps
87 def dumps(self, arg, proto=0): member in cPicklePicklerTests
117 def dumps(self, arg, proto=0): member in cPickleListPicklerTests
144 def dumps(self, arg, proto=0): member in cPickleFastPicklerTests
171 b = self.loads(self.dumps(a))
204 def dumps(self, arg, proto=0, fast=0): member in cPickleBigmemPickleTests
206 return cPickle.dumps(arg, proto)
225 self.assertRaises((AttributeError, RuntimeError), cPickle.dumps, n)
233 cPickle.dumps(res)
Dtest_xpickle.py39 def dumps(self, arg, proto=0, fast=False): member in DumpCPickle_LoadPickle
41 return cPickle.dumps(arg, proto)
51 def dumps(self, arg, proto=0, fast=False): member in DumpPickle_LoadCPickle
53 return pickle.dumps(arg, proto)
109 data = self.module.dumps((proto, obj), proto)
119 def dumps(self, arg, proto=0, fast=False): member in AbstractCompatTests
143 pickle = self.dumps(value, 0)
149 pickle = self.dumps(value, proto)
168 p = self.dumps(u, proto)
/external/python/cpython2/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(u"x"))
/external/python/cpython3/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"))
/external/tensorflow/tensorflow/contrib/learn/python/learn/estimators/
Drun_config_test.py71 with patch.dict("os.environ", {"TF_CONFIG": json.dumps(tf_config)}):
95 with patch.dict("os.environ", {"TF_CONFIG": json.dumps(tf_config)}):
110 with patch.dict("os.environ", {"TF_CONFIG": json.dumps(tf_config)}):
122 with patch.dict("os.environ", {"TF_CONFIG": json.dumps(tf_config)}):
139 {"TF_CONFIG": json.dumps(tf_config)}), self.assertRaisesRegexp(
157 {"TF_CONFIG": json.dumps(tf_config)}), self.assertRaisesRegexp(
177 with patch.dict("os.environ", {"TF_CONFIG": json.dumps(tf_config)}):
197 with patch.dict("os.environ", {"TF_CONFIG": json.dumps(tf_config)}):
215 with patch.dict("os.environ", {"TF_CONFIG": json.dumps(tf_config)}):
222 with patch.dict("os.environ", {"TF_CONFIG": json.dumps(tf_config)}):
[all …]
/external/grpc-grpc/tools/run_tests/performance/
Dbq_upload_result.py100 scenario_result['scenario']['clientConfig'] = json.dumps(
102 scenario_result['scenario']['serverConfig'] = json.dumps(
104 scenario_result['latencies'] = json.dumps(scenario_result['latencies'])
113 stats['latencies'] = json.dumps(stats['latencies'])
115 scenario_result['serverCores'] = json.dumps(scenario_result['serverCores'])
116 scenario_result['clientSuccess'] = json.dumps(
118 scenario_result['serverSuccess'] = json.dumps(
120 scenario_result['requestResults'] = json.dumps(

12345678910>>...22