From: <eo...@us...> - 2007-04-10 16:11:13
|
Revision: 1373 http://svn.sourceforge.net/pywebsvcs/?rev=1373&view=rev Author: eolson Date: 2007-04-10 09:11:11 -0700 (Tue, 10 Apr 2007) Log Message: ----------- Fix nested lists for rpc encoded. Add test. Modified Paths: -------------- trunk/zsi/ZSI/TC.py trunk/zsi/test/test_t8.py Modified: trunk/zsi/ZSI/TC.py =================================================================== --- trunk/zsi/ZSI/TC.py 2007-04-10 16:01:25 UTC (rev 1372) +++ trunk/zsi/ZSI/TC.py 2007-04-10 16:11:11 UTC (rev 1373) @@ -622,13 +622,13 @@ "xsd:anyType[" + str(len(pyobj)) + "]" ) for o in pyobj: #TODO maybe this should take **self.kwargs... - serializer = getattr(o, 'typecode', Any()) + serializer = getattr(o, 'typecode', Any(**self.kwargs)) serializer.serialize(array, sw, o, name='element', **kw) else: struct = elt.createAppendElement(ns, n) for o in pyobj: #TODO maybe this should take **self.kwargs... - serializer = getattr(o, 'typecode', Any()) + serializer = getattr(o, 'typecode', Any(**self.kwargs)) serializer.serialize(struct, sw, o, **kw) return Modified: trunk/zsi/test/test_t8.py =================================================================== --- trunk/zsi/test/test_t8.py 2007-04-10 16:01:25 UTC (rev 1372) +++ trunk/zsi/test/test_t8.py 2007-04-10 16:11:11 UTC (rev 1373) @@ -132,6 +132,15 @@ ps = ParsedSoap(xml, envelope=False) self.failUnless(int(ps.Parse(TC.Any())) == 12) + def check_any_dict_list_rpcenc(self): + sw = SoapWriter() + testObj = [{"a":1,"b":2}, {"d":4,"e":5}, {"f":{"x":9}, "g":[6,7.0]}] + typecode = TC.Any(aslist=True) + sw.serialize(testObj, typecode=typecode) + xml = str(sw) + ps = ParsedSoap(xml) + result = TC.Any().parse(ps.body_root, ps) + self.failUnless(result == testObj) # # Creates permutation of test options: "check", "check_any", etc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |