Lines Matching refs:xmlrpclib
6 import xmlrpclib
33 'abase64': xmlrpclib.Binary("my dog has fleas"),
34 'boolean': xmlrpclib.False,
37 'datetime1': xmlrpclib.DateTime('20050210T11:41:23'),
38 'datetime2': xmlrpclib.DateTime(
40 'datetime3': xmlrpclib.DateTime(
48 xmlrpclib.loads(xmlrpclib.dumps((alist,)))[0][0])
56 s = xmlrpclib.dumps((dt,))
57 (newdt,), m = xmlrpclib.loads(s, use_datetime=1)
61 (newdt,), m = xmlrpclib.loads(s, use_datetime=0)
62 self.assertEqual(newdt, xmlrpclib.DateTime('20050210T11:41:23'))
67 s = xmlrpclib.dumps((dt,))
68 (newdt,), m = xmlrpclib.loads(s, use_datetime=1)
72 (newdt,), m = xmlrpclib.loads(s, use_datetime=0)
73 self.assertEqual(newdt, xmlrpclib.DateTime('00010210T11:41:23'))
77 dt = xmlrpclib.DateTime(now.timetuple())
85 d = xmlrpclib.DateTime()
86 ((new_d,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((d,),
91 s = xmlrpclib.dumps((new_d,), methodresponse=True)
100 ((t2,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((t,)))
104 self.assertRaises(OverflowError, xmlrpclib.dumps, (2L**99,))
107 self.assertRaises(TypeError, xmlrpclib.dumps, ({(1,2,3): 1},))
113 self.assertRaises(TypeError, xmlrpclib.dumps, (l,))
119 self.assertRaises(TypeError, xmlrpclib.dumps, (d,))
123 self.assertRaises(OverflowError, xmlrpclib.dumps,
126 xmlrpclib.dumps((xmlrpclib.MAXINT, xmlrpclib.MININT))
127 self.assertRaises(OverflowError, xmlrpclib.dumps, (xmlrpclib.MAXINT+1,))
128 self.assertRaises(OverflowError, xmlrpclib.dumps, (xmlrpclib.MININT-1,))
133 m = xmlrpclib.Marshaller()
134 m.dump_int(xmlrpclib.MAXINT, dummy_write)
135 m.dump_int(xmlrpclib.MININT, dummy_write)
136 self.assertRaises(OverflowError, m.dump_int, xmlrpclib.MAXINT+1, dummy_write)
137 self.assertRaises(OverflowError, m.dump_int, xmlrpclib.MININT-1, dummy_write)
143 strg = xmlrpclib.dumps(arg1, allow_none=True)
145 xmlrpclib.loads(strg)[0][0])
146 self.assertRaises(TypeError, xmlrpclib.dumps, (arg1,))
175 (s, d), m = xmlrpclib.loads(utf8)
193 self.assertEqual(xmlrpclib.escape("a&b"), "a&b")
194 self.assertEqual(xmlrpclib.escape("a<b"), "a<b")
195 self.assertEqual(xmlrpclib.escape("a>b"), "a>b")
199 f = xmlrpclib.Fault(42, 'Test Fault')
204 f = xmlrpclib.Fault(42, 'Test Fault')
205 s = xmlrpclib.dumps((f,))
206 (newf,), m = xmlrpclib.loads(s)
210 s = xmlrpclib.Marshaller().dumps(f)
211 self.assertRaises(xmlrpclib.Fault, xmlrpclib.loads, s)
216 t = xmlrpclib.DateTime()
220 t = xmlrpclib.DateTime(d)
225 t = xmlrpclib.DateTime(d)
230 t = xmlrpclib.DateTime(d)
235 t = xmlrpclib.DateTime(d)
240 t = xmlrpclib.DateTime(d)
246 t1 = xmlrpclib.DateTime()
248 tref = xmlrpclib.DateTime(datetime.datetime(2007,9,8,7,11,13))
251 t2 = xmlrpclib._datetime(d)
256 t = xmlrpclib.Binary()
261 t = xmlrpclib.Binary(d)
267 t1 = xmlrpclib.Binary()
271 t2 = xmlrpclib._binary(de)
453 p = xmlrpclib.ServerProxy(URL)
455 except (xmlrpclib.ProtocolError, socket.error), e:
466 p = xmlrpclib.ServerProxy(URL)
469 except (xmlrpclib.ProtocolError, socket.error) as e:
476 server = xmlrpclib.ServerProxy(u"http://%s:%d/RPC2"%(ADDR, PORT))
493 p = xmlrpclib.ServerProxy(URL)
499 except (xmlrpclib.ProtocolError, socket.error), e:
508 p = xmlrpclib.ServerProxy(URL)
511 except (xmlrpclib.ProtocolError, socket.error), e:
522 p = xmlrpclib.ServerProxy(URL)
525 except (xmlrpclib.ProtocolError, socket.error), e:
535 p = xmlrpclib.ServerProxy(URL)
538 except (xmlrpclib.ProtocolError, socket.error), e:
546 p = xmlrpclib.ServerProxy(URL)
547 multicall = xmlrpclib.MultiCall(p)
555 except (xmlrpclib.ProtocolError, socket.error), e:
563 p = xmlrpclib.ServerProxy(URL)
564 multicall = xmlrpclib.MultiCall(p)
576 except (xmlrpclib.ProtocolError, socket.error), e:
602 p = xmlrpclib.ServerProxy(URL+"/foo")
604 self.assertRaises(xmlrpclib.Fault, p.add, 6, 8)
606 p = xmlrpclib.ServerProxy(URL+"/foo/bar")
608 self.assertRaises(xmlrpclib.Fault, p.pow, 6, 8)
638 p = xmlrpclib.ServerProxy(URL)
658 p = xmlrpclib.ServerProxy(URL)
675 p = xmlrpclib.ServerProxy(URL)
697 class Transport(xmlrpclib.Transport):
702 return xmlrpclib.Transport.parse_response(self, response)
708 return xmlrpclib.Transport.send_content(self, connection, body)
716 p = xmlrpclib.ServerProxy(URL, transport=t)
728 p = xmlrpclib.ServerProxy(URL, transport=t)
729 cm = self.assertRaisesRegexp(xmlrpclib.ProtocolError,
736 p = xmlrpclib.ServerProxy(URL, transport=t)
760 p = xmlrpclib.ServerProxy(self.url)
764 t = xmlrpclib.Transport()
765 p = xmlrpclib.ServerProxy(self.url, transport=t)
808 p = xmlrpclib.ServerProxy(URL)
810 except (xmlrpclib.ProtocolError, socket.error), e:
821 p = xmlrpclib.ServerProxy(URL)
823 except (xmlrpclib.ProtocolError, socket.error), e:
841 p = xmlrpclib.ServerProxy(URL)
843 except (xmlrpclib
906 self.assertRaises(xmlrpclib.Fault, xmlrpclib.loads, handle[44:])
941 class FakeTransport(xmlrpclib.Transport):
950 conn = xmlrpclib.Transport.make_connection(self, host)
959 proxy = xmlrpclib.ServerProxy("http://example.com/",
971 xmlrpclib.Transport.send_user_agent(self, conn)
981 xmlrpclib.Transport.send_host(self, conn, host)
991 xmlrpclib.Transport.send_request(self, conn, url, body)
1002 xmlrpclib.Transport.send_content(self, conn, body)