Add tests to marshall double with xmlrpc.client.
This commit is contained in:
parent
109d57358e
commit
1917ea964e
|
@ -154,6 +154,22 @@ class XMLRPCTestCase(unittest.TestCase):
|
|||
self.assertRaises(OverflowError, m.dump_int,
|
||||
xmlrpclib.MININT-1, dummy_write)
|
||||
|
||||
def test_dump_double(self):
|
||||
xmlrpclib.dumps((float(2 ** 34),))
|
||||
xmlrpclib.dumps((float(xmlrpclib.MAXINT),
|
||||
float(xmlrpclib.MININT)))
|
||||
xmlrpclib.dumps((float(xmlrpclib.MAXINT + 42),
|
||||
float(xmlrpclib.MININT - 42)))
|
||||
|
||||
def dummy_write(s):
|
||||
pass
|
||||
|
||||
m = xmlrpclib.Marshaller()
|
||||
m.dump_double(xmlrpclib.MAXINT, dummy_write)
|
||||
m.dump_double(xmlrpclib.MININT, dummy_write)
|
||||
m.dump_double(xmlrpclib.MAXINT + 42, dummy_write)
|
||||
m.dump_double(xmlrpclib.MININT - 42, dummy_write)
|
||||
|
||||
def test_dump_none(self):
|
||||
value = alist + [None]
|
||||
arg1 = (alist + [None],)
|
||||
|
|
Loading…
Reference in New Issue