Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/zeep/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
class Base(object):

def add(self, url, content):
raise NotImplemented()
raise NotImplementedError()

def get(self, url):
raise NotImplemented()
raise NotImplementedError()


class InMemoryCache(Base):
Expand Down Expand Up @@ -131,6 +131,8 @@ def _decode_data(self, data):
data = str(data)
if data.startswith(self._version_string):
return base64.b64decode(data[len(self._version_string):])
# Return None for invalid/incompatible cache data
return None

@property
def _version_string(self):
Expand Down
2 changes: 2 additions & 0 deletions src/zeep/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ def _get_port(self, service, name):
if not port:
raise ValueError("Port not found")
else:
if not service.ports:
raise ValueError("No ports available in service")
port = list(service.ports.values())[0]
return port

Expand Down
2 changes: 2 additions & 0 deletions src/zeep/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ def create_xml_soap_map(values):

def guess_xsd_type(obj):
"""Return the XSD Type for the given object"""
# Check bool before int since bool is a subclass of int in Python
if isinstance(obj, bool):
return xsd.Boolean()
if isinstance(obj, int):
return xsd.Integer()
if isinstance(obj, float):
return xsd.Float()
# Check datetime before date since datetime is a subclass of date
if isinstance(obj, datetime.datetime):
return xsd.DateTime()
if isinstance(obj, datetime.date):
Expand Down