Lines Matching refs:marshal
4 import marshal
20 s = marshal.dumps(expected)
21 got = marshal.loads(s)
23 marshal.dump(expected, file(test_support.TESTFN, "wb"))
24 got = marshal.load(file(test_support.TESTFN, "rb"))
46 got = marshal.loads(s)
55 new = marshal.loads(marshal.dumps(b))
58 marshal.dump(b, file(test_support.TESTFN, "wb"))
59 new = marshal.load(file(test_support.TESTFN, "rb"))
71 s = marshal.dumps(f)
72 got = marshal.loads(s)
74 marshal.dump(f, file(test_support.TESTFN, "wb"))
75 got = marshal.load(file(test_support.TESTFN, "rb"))
80 s = marshal.dumps(f, 2)
81 got = marshal.loads(s)
84 s = marshal.dumps(f, 1)
85 got = marshal.loads(s)
93 s = marshal.dumps(f)
94 got = marshal.loads(s)
97 s = marshal.dumps(f, 1)
98 got = marshal.loads(s)
101 marshal.dump(f, file(test_support.TESTFN, "wb"))
102 got = marshal.load(file(test_support.TESTFN, "rb"))
105 marshal.dump(f, file(test_support.TESTFN, "wb"), 1)
106 got = marshal.load(file(test_support.TESTFN, "rb"))
114 new = marshal.loads(marshal.dumps(s))
117 marshal.dump(s, file(test_support.TESTFN, "wb"))
118 new = marshal.load(file(test_support.TESTFN, "rb"))
125 new = marshal.loads(marshal.dumps(s))
128 marshal.dump(s, file(test_support.TESTFN, "wb"))
129 new = marshal.load(file(test_support.TESTFN, "rb"))
139 new = marshal.loads(marshal.dumps(b))
141 marshal.dump(b, file(test_support.TESTFN, "wb"))
142 new = marshal.load(file(test_support.TESTFN, "rb"))
148 new = marshal.loads(marshal.dumps(StopIteration))
154 new = marshal.loads(marshal.dumps(co))
168 new = marshal.loads(marshal.dumps(self.d))
170 marshal.dump(self.d, file(test_support.TESTFN, "wb"))
171 new = marshal.load(file(test_support.TESTFN, "rb"))
177 new = marshal.loads(marshal.dumps(lst))
179 marshal.dump(lst, file(test_support.TESTFN, "wb"))
180 new = marshal.load(file(test_support.TESTFN, "rb"))
186 new = marshal.loads(marshal.dumps(t))
188 marshal.dump(t, file(test_support.TESTFN, "wb"))
189 new = marshal.load(file(test_support.TESTFN, "rb"))
196 new = marshal.loads(marshal.dumps(t))
200 marshal.dump(t, file(test_support.TESTFN, "wb"))
201 new = marshal.load(file(test_support.TESTFN, "rb"))
208 marshal.dumps([128] * 1000)
211 self.assertRaises(Exception, marshal.loads, '0')
212 self.assertRaises(Exception, marshal.loads, 'f')
213 self.assertRaises(Exception, marshal.loads, marshal.dumps(5L)[:-1])
217 self.assertEqual(marshal.loads(marshal.dumps(5, 0)), 5)
218 self.assertEqual(marshal.loads(marshal.dumps(5, 1)), 5)
225 marshal.loads(c)
241 run_tests(100, marshal.loads)
244 self.assertRaises(ValueError, marshal.loads, s)
260 data = marshal.dumps(head)
261 new_head = marshal.loads(data)
268 self.assertRaises(ValueError, marshal.dumps, head)
279 self.assertRaises(ValueError, marshal.dumps, subtyp())
286 marshal.dumps(testString)
291 self.assertRaises(ValueError, marshal.loads, invalid_string)
303 self.assertRaises(ValueError, marshal.dump, data, f)
346 for v in range(marshal.version + 1):
355 for v in range(marshal.version + 1):
360 self.assertEqual(marshal.loads(data), obj)
380 for v in range(marshal.version + 1):
381 data = marshal.dumps(obj, v)
390 for v in range(marshal.version + 1):
391 data = marshal.dumps(obj, v)