Skip to content

Commit

Permalink
Fix bug on null response
Browse files Browse the repository at this point in the history
  • Loading branch information
allevo committed Feb 15, 2013
1 parent 57c1cfb commit 8cf3ea6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resuds/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def __repr__(self):
class ElementFactory(object):
@classmethod
def rebuild(cls, obj):
if not obj:
return ''
if isinstance(obj, (int, float, str)):
return str(obj)
if cls.is_list(obj):
Expand Down
5 changes: 5 additions & 0 deletions resuds/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ def testCreateAdspace(self):
res = self.client.CreateAdspace(name='', pwd='', operatorId='', Adspace=adspace)
self.assertTrue(res.isdigit())

@httprettified
def testAANoneTypeObjectInRebuild(self):
self.setupHttpPretty('deleteAdspace')
self.client.DeleteAdSpace(name='', pwd='', operatorId='', adSpaceId=123456)

@httprettified
def testComplicateCase(self):
with open(os.path.join(LOCALDIR, 'getReport.wsdl')) as fp:
Expand Down
1 change: 1 addition & 0 deletions resuds/tests/wsdl/deleteAdspace.wsdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:EmptyResponse xmlns:ns3="http://Amobee.com/" xmlns:ns2="http://Amobee.com/Common/Schema"/></soap:Body></soap:Envelope>

0 comments on commit 8cf3ea6

Please sign in to comment.