mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
simple dumps/loads test case for xmlrpclib
This commit is contained in:
parent
55f2099b2f
commit
419abdaff2
1 changed files with 23 additions and 0 deletions
23
Lib/test/test_xmlrpc.py
Normal file
23
Lib/test/test_xmlrpc.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import test_support
|
||||
import unittest
|
||||
import xmlrpclib
|
||||
|
||||
alist = [{'astring': 'foo@bar.baz.spam',
|
||||
'afloat': 7283.43,
|
||||
'anotherlist': ['.zyx.41'],
|
||||
'abase64': xmlrpclib.Binary("my dog has fleas"),
|
||||
'boolean': xmlrpclib.False,
|
||||
}]
|
||||
|
||||
class XMLRPCTestCase(unittest.TestCase):
|
||||
|
||||
def test_dump_load(self):
|
||||
self.assertEquals(alist,
|
||||
xmlrpclib.loads(xmlrpclib.dumps((alist,)))[0][0])
|
||||
|
||||
def test_main():
|
||||
test_support.run_unittest(XMLRPCTestCase)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue