Skip to content

Commit 6961e76

Browse files
author
y1thof
committed
add test for dir(ServiceProxy)
1 parent 99d63e5 commit 6961e76

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/zeep/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __getitem__(self, key):
7070

7171
def __dir__(self):
7272
""" Return the names of the operations. """
73-
return list(super(ServiceProxy, self).__dir__()
73+
return list(dir(super(ServiceProxy, self))
7474
+ list(self.__dict__)
7575
+ list(self._binding.port_type.operations))
7676
# using list() on the dicts for Python 3 compatibility

tests/test_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ def test_service_proxy_non_existing():
4343
assert client_obj.service.NonExisting
4444

4545

46+
def test_service_proxy_dir_operations():
47+
client_obj = client.Client('tests/wsdl_files/soap.wsdl')
48+
operations = [op for op in dir(client_obj.service) if not op.startswith('_')]
49+
assert set(operations) == set(['GetLastTradePrice', 'GetLastTradePriceNoOutput'])
50+
51+
4652
def test_open_from_file_object():
4753
with open('tests/wsdl_files/soap_transport_err.wsdl', 'rb') as fh:
4854
client_obj = client.Client(fh)

0 commit comments

Comments
 (0)