mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Add tests to marshall double with xmlrpc.client.
This commit is contained in:
parent
109d57358e
commit
1917ea964e
1 changed files with 16 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue