Lines Matching refs:xmlrpclib
8 import xmlrpc.client as xmlrpclib namespace
33 'abase64': xmlrpclib.Binary(b"my dog has fleas"),
39 'datetime1': xmlrpclib.DateTime('20050210T11:41:23'),
40 'datetime2': xmlrpclib.DateTime(
42 'datetime3': xmlrpclib.DateTime(
49 dump = xmlrpclib.dumps((alist,))
50 load = xmlrpclib.loads(dump)
59 self.assertEqual(dt, xmlrpclib.DateTime('20050210T11:41:23'))
60 s = xmlrpclib.dumps((dt,))
62 result, m = xmlrpclib.loads(s, use_builtin_types=True)
68 result, m = xmlrpclib.loads(s, use_builtin_types=False)
71 self.assertIs(type(newdt), xmlrpclib.DateTime)
74 result, m = xmlrpclib.loads(s, use_datetime=True)
80 result, m = xmlrpclib.loads(s, use_datetime=False)
83 self.assertIs(type(newdt), xmlrpclib.DateTime)
90 self.assertEqual(dt, xmlrpclib.DateTime('00010210T11:41:23'))
91 s = xmlrpclib.dumps((dt,))
93 result, m = xmlrpclib.loads(s, use_builtin_types=True)
99 result, m = xmlrpclib.loads(s, use_builtin_types=False)
102 self.assertIs(type(newdt), xmlrpclib.DateTime)
106 d = xmlrpclib.DateTime()
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,))
144 self.assertRaises(OverflowError, xmlrpclib.dumps,
147 xmlrpclib.dumps((xmlrpclib.MAXINT, xmlrpclib.MININT))
148 self.assertRaises(OverflowError, xmlrpclib.dumps,
149 (xmlrpclib.MAXINT+1,))
150 self.assertRaises(OverflowError, xmlrpclib.dumps,
151 (xmlrpclib.MININT-1,))
156 m = xmlrpclib.Marshaller()
157 m.dump_int(xmlrpclib.MAXINT, dummy_write)
158 m.dump_int(xmlrpclib.MININT, dummy_write)
160 xmlrpclib.MAXINT+1, dummy_write)
162 xmlrpclib.MININT-1, dummy_write)
165 xmlrpclib.dumps((float(2 ** 34),))
166 xmlrpclib.dumps((float(xmlrpclib.MAXINT),
167 float(xmlrpclib.MININT)))
168 xmlrpclib.dumps((float(xmlrpclib.MAXINT + 42),
169 float(xmlrpclib.MININT - 42)))
174 m = xmlrpclib.Marshaller()
175 m.dump_double(xmlrpclib.MAXINT, dummy_write)
176 m.dump_double(xmlrpclib.MININT, dummy_write)
177 m.dump_double(xmlrpclib.MAXINT + 42, dummy_write)
178 m.dump_double(xmlrpclib.MININT - 42, dummy_write)
183 strg = xmlrpclib.dumps(arg1, allow_none=True)
185 xmlrpclib.loads(strg)[0][0])
186 self.assertRaises(TypeError, xmlrpclib.dumps, (arg1,))
191 strg = xmlrpclib.dumps((value,), encoding='iso-8859-15')
193 self.assertEqual(xmlrpclib.loads(strg)[0][0], value)
195 self.assertEqual(xmlrpclib.loads(strg)[0][0], value)
197 strg = xmlrpclib.dumps((value,), encoding='iso-8859-15',
199 self.assertEqual(xmlrpclib.loads(strg)[0][0], value)
201 self.assertEqual(xmlrpclib.loads(strg)[0][0], value)
204 strg = xmlrpclib.dumps((value,), encoding='iso-8859-15',
206 self.assertEqual(xmlrpclib.loads(strg)[0][0], value)
207 self.assertEqual(xmlrpclib.loads(strg)[1], methodname)
211 self.assertEqual(sample, xmlrpclib.Binary(sample))
212 for type_ in bytes, bytearray, xmlrpclib.Binary:
214 s = xmlrpclib.dumps((value,))
216 result, m = xmlrpclib.loads(s, use_builtin_types=True)
222 result, m = xmlrpclib.loads(s, use_builtin_types=False)
225 self.assertIs(type(newvalue), xmlrpclib.Binary)
229 ResponseError = xmlrpclib.ResponseError
231 self.assertRaises(ResponseError, xmlrpclib.loads, data)
235 self.assertRaises(ResponseError, xmlrpclib.loads, data)
240 self.assertRaises(ResponseError, xmlrpclib.loads, data)
244 result, m = xmlrpclib.loads(dump, **kwargs)
261 xmlrpclib.Binary(b'\x00byte string\xff'))
265 xmlrpclib.DateTime('20050210T11:41:23'))
322 response = xmlrpclib.dumps((5,), methodresponse=True)
346 with xmlrpclib.ServerProxy(url) as p:
440 self.assertEqual(xmlrpclib.escape("a&b"), "a&b")
441 self.assertEqual(xmlrpclib.escape("a<b"), "a<b")
442 self.assertEqual(xmlrpclib.escape("a>b"), "a>b")
446 f = xmlrpclib.Fault(42, 'Test Fault')
451 f = xmlrpclib.Fault(42, 'Test Fault')
452 s = xmlrpclib.dumps((f,))
453 (newf,), m = xmlrpclib.loads(s)
457 s = xmlrpclib.Marshaller().dumps(f)
458 self.assertRaises(xmlrpclib.Fault, xmlrpclib.loads, s)
474 t = xmlrpclib.DateTime()
480 t = xmlrpclib.DateTime(d)
486 t = xmlrpclib.DateTime(d)
491 t = xmlrpclib.DateTime(d)
496 t = xmlrpclib.DateTime(d)
501 t = xmlrpclib.DateTime(d)
507 t1 = xmlrpclib.DateTime()
509 tref = xmlrpclib.DateTime(datetime.datetime(2007,9,8,7,11,13))
512 t2 = xmlrpclib._datetime(d)
517 dtime = xmlrpclib.DateTime(now.timetuple())
530 dtime_then = xmlrpclib.DateTime(then.timetuple())
570 t = xmlrpclib.Binary()
575 t = xmlrpclib.Binary(d)
581 t1 = xmlrpclib.Binary()
585 t2 = xmlrpclib._binary(de)
755 xmlrpclib.ServerProxy(URL).my_function()
756 except (xmlrpclib.ProtocolError, OSError) as e:
793 p = xmlrpclib.ServerProxy(URL)
795 except (xmlrpclib.ProtocolError, OSError) as e:
805 p = xmlrpclib.ServerProxy(URL)
808 except (xmlrpclib.ProtocolError, OSError) as e:
819 p = xmlrpclib.ServerProxy(URL, encoding='iso-8859-15')
822 except (xmlrpclib.ProtocolError, socket.error) as e:
830 p = xmlrpclib.ServerProxy(URL, encoding='ascii')
832 except (xmlrpclib.ProtocolError, socket.error) as e:
854 p = xmlrpclib.ServerProxy(URL)
857 except (xmlrpclib.ProtocolError, OSError) as e:
867 p = xmlrpclib.ServerProxy(URL)
870 except (xmlrpclib.ProtocolError, OSError) as e:
881 p = xmlrpclib.ServerProxy(URL)
884 except (xmlrpclib.ProtocolError, OSError) as e:
894 p = xmlrpclib.ServerProxy(URL)
897 except (xmlrpclib.ProtocolError, OSError) as e:
905 p = xmlrpclib.ServerProxy(URL)
906 multicall = xmlrpclib.MultiCall(p)
914 except (xmlrpclib.ProtocolError, OSError) as e:
922 p = xmlrpclib.ServerProxy(URL)
923 multicall = xmlrpclib.MultiCall(p)
935 except (xmlrpclib.ProtocolError, OSError) as e:
953 server = xmlrpclib.ServerProxy("http://%s:%d/RPC2" % (ADDR, PORT))
958 server = xmlrpclib.ServerProxy("http://%s:%d/RPC2" % (ADDR, PORT))
972 with xmlrpclib.ServerProxy(URL) as server:
981 with xmlrpclib.ServerProxy(URL) as server:
983 except xmlrpclib.Fault:
999 p = xmlrpclib.ServerProxy(URL)
1002 except (xmlrpclib.ProtocolError, socket.error) as e:
1013 p = xmlrpclib.ServerProxy(URL+"/foo")
1015 self.assertRaises(xmlrpclib.Fault, p.add, 6, 8)
1018 p = xmlrpclib.ServerProxy(URL+"/foo/bar")
1020 self.assertRaises(xmlrpclib.Fault, p.pow, 6, 8)
1023 p = xmlrpclib.ServerProxy(URL+"/is/broken")
1024 self.assertRaises(xmlrpclib.Fault, p.add, 6, 8)
1027 p = xmlrpclib.ServerProxy(URL+"/invalid")
1028 self.assertRaises(xmlrpclib.Fault, p.add, 6, 8)
1031 p = xmlrpclib.ServerProxy(URL+"/foo?k=v#frag")
1035 p = xmlrpclib.ServerProxy(URL+"/foo#frag")
1039 p = xmlrpclib.ServerProxy(URL+"/foo?k=v")
1043 p = xmlrpclib.ServerProxy(URL)
1047 p = xmlrpclib.ServerProxy(URL + "/")
1051 p = xmlrpclib.ServerProxy(URL + "?k=v")
1055 p = xmlrpclib.ServerProxy(URL + "#frag")
1087 p = xmlrpclib.ServerProxy(URL)
1109 p = xmlrpclib.ServerProxy(URL)
1128 p = xmlrpclib.ServerProxy(URL)
1152 class Transport(xmlrpclib.Transport):
1157 return xmlrpclib.Transport.parse_response(self, response)
1163 return xmlrpclib.Transport.send_content(self, connection, body)
1171 p = xmlrpclib.ServerProxy(URL, transport=t)
1184 p = xmlrpclib.ServerProxy(URL, transport=t)
1185 cm = self.assertRaisesRegex(xmlrpclib.ProtocolError,
1193 p = xmlrpclib.ServerProxy(URL, transport=t)
1212 encoded = xmlrpclib.gzip_encode(data)
1213 decoded = xmlrpclib.gzip_decode(encoded)
1217 encoded = xmlrpclib.gzip_encode(data)
1221 xmlrpclib.gzip_decode(encoded)
1223 xmlrpclib.gzip_decode(encoded, max_decode=-1)
1250 p = xmlrpclib.ServerProxy(URL, headers=[('X-Test', 'foo')])
1257 p = xmlrpclib.ServerProxy(
1266 p = xmlrpclib.ServerProxy(URL, headers=[])
1273 p = xmlrpclib.ServerProxy(URL, headers=(('X-Test', 'foo'),))
1280 p = xmlrpclib.ServerProxy(URL, headers={'X-Test': 'foo'}.items())
1296 p = xmlrpclib.ServerProxy(self.url)
1300 t = xmlrpclib.Transport()
1301 p = xmlrpclib.ServerProxy(self.url, transport=t)
1347 p = xmlrpclib.ServerProxy(URL)
1349 except (xmlrpclib.ProtocolError, OSError) as e:
1360 p = xmlrpclib.ServerProxy(URL)
1362 except (xmlrpclib.ProtocolError, OSError) as e:
1380 p = xmlrpclib.ServerProxy(URL)
1382 except (xmlrpclib.ProtocolError, OSError) as e:
1460 self.assertRaises(xmlrpclib.Fault, xmlrpclib.loads, handle[44:])
1483 marshaled = xmlrpclib.dumps((expected_bytes, expected_date), 'foobar')