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.getperson()
|
||||
p = client.service.listpersons()
|
||||
print repr(p)
|
||||
p = client.service.setpersons(p)
|
||||
print repr(p)
|
||||
|
||||
p = client.factory.create('ns0:Person')
|
||||
p.id = 4
|
||||
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
|
||||
lastname = unicode
|
||||
|
||||
hobbies = [unicode]
|
||||
|
||||
def __repr__(self):
|
||||
return "Person(%s, %s %s, %s)" % (
|
||||
self.id,
|
||||
self.firstname, self.lastname,
|
||||
self.hobbies
|
||||
)
|
||||
|
||||
|
||||
class DemoRoot(WSRoot):
|
||||
@expose(int)
|
||||
@ -48,6 +57,8 @@ class DemoRoot(WSRoot):
|
||||
p.id = 12
|
||||
p.firstname = u'Ross'
|
||||
p.lastname = u'Geler'
|
||||
p.hobbies = []
|
||||
print p
|
||||
return p
|
||||
|
||||
@expose([Person])
|
||||
@ -62,6 +73,7 @@ class DemoRoot(WSRoot):
|
||||
p.firstname = u('Rachel')
|
||||
p.lastname = u('Green')
|
||||
r.append(p)
|
||||
print r
|
||||
return r
|
||||
|
||||
@expose(Person)
|
||||
@ -72,6 +84,7 @@ class DemoRoot(WSRoot):
|
||||
@expose([Person])
|
||||
@validate([Person])
|
||||
def setpersons(self, persons):
|
||||
print persons
|
||||
return persons
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user