mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Patch #1070046: Marshal new-style objects like InstanceType
in xmlrpclib.
This commit is contained in:
parent
9eec51c04f
commit
07529354db
4 changed files with 33 additions and 4 deletions
|
@ -86,6 +86,15 @@ class XMLRPCTestCase(unittest.TestCase):
|
|||
s = xmlrpclib.dumps((new_d,), methodresponse=True)
|
||||
self.assert_(isinstance(s, str))
|
||||
|
||||
def test_newstyle_class(self):
|
||||
class T(object):
|
||||
pass
|
||||
t = T()
|
||||
t.x = 100
|
||||
t.y = "Hello"
|
||||
((t2,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((t,)))
|
||||
self.assertEquals(t2, t.__dict__)
|
||||
|
||||
def test_dump_big_long(self):
|
||||
self.assertRaises(OverflowError, xmlrpclib.dumps, (2L**99,))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue