Add more list corner cases to test the soap behavior with empty arrays
This commit is contained in:
parent
b8de4600e0
commit
1512c3902f
@ -10,5 +10,23 @@ print client.service.multiply(4, 5)
|
|||||||
print client.service.helloworld()
|
print client.service.helloworld()
|
||||||
print client.service.getperson()
|
print client.service.getperson()
|
||||||
p = client.service.listpersons()
|
p = client.service.listpersons()
|
||||||
|
print repr(p)
|
||||||
p = client.service.setpersons(p)
|
p = client.service.setpersons(p)
|
||||||
|
print repr(p)
|
||||||
|
|
||||||
|
p = client.factory.create('ns0:Person')
|
||||||
|
p.id = 4
|
||||||
print p
|
print p
|
||||||
|
|
||||||
|
a = client.factory.create('ns0:Person_Array')
|
||||||
|
print a
|
||||||
|
|
||||||
|
a = client.service.setpersons(a)
|
||||||
|
print repr(a)
|
||||||
|
|
||||||
|
a.item.append(p)
|
||||||
|
print repr(a)
|
||||||
|
|
||||||
|
a = client.service.setpersons(a)
|
||||||
|
print repr(a)
|
||||||
|
|
||||||
|
@ -26,6 +26,15 @@ class Person(object):
|
|||||||
firstname = unicode
|
firstname = unicode
|
||||||
lastname = unicode
|
lastname = unicode
|
||||||
|
|
||||||
|
hobbies = [unicode]
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return "Person(%s, %s %s, %s)" % (
|
||||||
|
self.id,
|
||||||
|
self.firstname, self.lastname,
|
||||||
|
self.hobbies
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class DemoRoot(WSRoot):
|
class DemoRoot(WSRoot):
|
||||||
@expose(int)
|
@expose(int)
|
||||||
@ -48,6 +57,8 @@ class DemoRoot(WSRoot):
|
|||||||
p.id = 12
|
p.id = 12
|
||||||
p.firstname = u'Ross'
|
p.firstname = u'Ross'
|
||||||
p.lastname = u'Geler'
|
p.lastname = u'Geler'
|
||||||
|
p.hobbies = []
|
||||||
|
print p
|
||||||
return p
|
return p
|
||||||
|
|
||||||
@expose([Person])
|
@expose([Person])
|
||||||
@ -62,6 +73,7 @@ class DemoRoot(WSRoot):
|
|||||||
p.firstname = u('Rachel')
|
p.firstname = u('Rachel')
|
||||||
p.lastname = u('Green')
|
p.lastname = u('Green')
|
||||||
r.append(p)
|
r.append(p)
|
||||||
|
print r
|
||||||
return r
|
return r
|
||||||
|
|
||||||
@expose(Person)
|
@expose(Person)
|
||||||
@ -72,6 +84,7 @@ class DemoRoot(WSRoot):
|
|||||||
@expose([Person])
|
@expose([Person])
|
||||||
@validate([Person])
|
@validate([Person])
|
||||||
def setpersons(self, persons):
|
def setpersons(self, persons):
|
||||||
|
print persons
|
||||||
return persons
|
return persons
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user