[Patch #628208] Test the 'nil' extension

This commit is contained in:
Andrew M. Kuchling 2003-04-25 00:27:24 +00:00
parent a4c2b7485b
commit 0b85203954
1 changed files with 8 additions and 0 deletions

View File

@ -29,6 +29,14 @@ class XMLRPCTestCase(unittest.TestCase):
self.assertRaises(OverflowError, xmlrpclib.dumps,
(int(2L**34),))
def test_dump_none(self):
value = alist + [None]
arg1 = (alist + [None],)
strg = xmlrpclib.dumps(arg1, allow_none=True)
self.assertEquals(value,
xmlrpclib.loads(strg)[0][0])
self.assertRaises(TypeError, xmlrpclib.dumps, (arg1,))
def test_main():
test_support.run_unittest(XMLRPCTestCase)