Skip to content

Commit a243090

Browse files
committed
lint
1 parent 5542005 commit a243090

11 files changed

+18
-77
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ install:
55
pip install bumpversion twine wheel
66

77
lint:
8-
flake8 src/ tests/
8+
flake8 src/
9+
flake8 --ignore=E501 tests/
910
isort --recursive --check-only --diff src tests
1011

1112
clean:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
'pytest-tornado==0.4.5',
4040

4141
# Linting
42-
'isort==4.2.5',
42+
'isort==4.2.15',
4343
'flake8==3.3.0',
4444
'flake8-blind-except==0.1.1',
4545
'flake8-debugger==1.4.0',

tests/test_asyncio_transport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from lxml import etree
55
from pretend import stub
66

7-
from zeep import asyncio, cache, exceptions
7+
from zeep import asyncio, exceptions
88

99

1010
@pytest.mark.requests

tests/test_client_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_factory_namespace():
1313

1414
def test_factory_no_reference():
1515
client = Client('tests/wsdl_files/soap.wsdl')
16-
factory = client.type_factory('http://example.com/stockquote.xsd')
16+
1717
obj_1 = client.get_type('ns0:ArrayOfAddress')()
1818
obj_1.Address.append({
1919
'NameFirst': 'J',

tests/test_helpers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from collections import OrderedDict
33

44
from lxml import etree
5-
from six import binary_type
65

76
from tests.utils import assert_nodes_equal, load_xml, render_node
87
from zeep import helpers, xsd

tests/test_soap_multiref.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import io
22

33
import pytest
4-
import requests_mock
5-
from lxml import etree
64
from pretend import stub
7-
from six import StringIO
85

9-
from tests.utils import DummyTransport, assert_nodes_equal
10-
from zeep import Client, wsdl
6+
from zeep import Client
117
from zeep.transports import Transport
128

139

@@ -74,10 +70,12 @@ def test_parse_multiref_soap_response():
7470
<wsdl:operation name="TestOperation">
7571
<soap:operation soapAction=""/>
7672
<wsdl:input name="TestOperationRequest">
77-
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
73+
<soap:body use="encoded"
74+
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
7875
</wsdl:input>
7976
<wsdl:output name="TestOperationResponse">
80-
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
77+
<soap:body use="encoded"
78+
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
8179
</wsdl:output>
8280
</wsdl:operation>
8381
</wsdl:binding>
@@ -88,7 +86,7 @@ def test_parse_multiref_soap_response():
8886
</wsdl:port>
8987
</wsdl:service>
9088
</wsdl:definitions>
91-
""".strip())
89+
""".strip()) # noqa
9290

9391
content = """
9492
<?xml version="1.0"?>
@@ -217,7 +215,7 @@ def test_parse_multiref_soap_response_child():
217215
</wsdl:port>
218216
</wsdl:service>
219217
</wsdl:definitions>
220-
""".strip())
218+
""".strip()) # noqa
221219

222220
content = """
223221
<?xml version="1.0"?>
@@ -246,7 +244,7 @@ def test_parse_multiref_soap_response_child():
246244
</multiRef>
247245
</soapenv:Body>
248246
</soapenv:Envelope>
249-
""".strip()
247+
""".strip() # noqa
250248

251249
client = Client(wsdl_file, transport=Transport(),)
252250
response = stub(

tests/test_soap_xop.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import io
2-
3-
import pytest
41
import requests_mock
52
from lxml import etree
63
from pretend import stub
74
from requests_toolbelt.multipart.decoder import MultipartDecoder
85
from six import StringIO
96

10-
from tests.utils import assert_nodes_equal, load_xml
7+
from tests.utils import assert_nodes_equal
118
from zeep import Client
129
from zeep.transports import Transport
1310
from zeep.wsdl.attachments import MessagePack
@@ -52,10 +49,6 @@ def test_rebuild_xml():
5249
'Content-Type': 'multipart/related; boundary=MIME_boundary; type="application/soap+xml"; start="<[email protected]>" 1'
5350
}
5451
)
55-
client = stub(
56-
transport=None,
57-
wsdl=stub(strict=True),
58-
xml_huge_tree=False)
5952

6053
decoder = MultipartDecoder(
6154
response.content, response.headers['Content-Type'], 'utf-8')

tests/test_wsdl_messages_document.py

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -65,58 +65,6 @@ def test_parse():
6565
assert operation.output.signature(as_output=True) == 'xsd:string'
6666

6767

68-
def test_empty_input_parse():
69-
wsdl_content = StringIO("""
70-
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
71-
xmlns:tns="http://tests.python-zeep.org/tns"
72-
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
73-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
74-
targetNamespace="http://tests.python-zeep.org/tns">
75-
<types>
76-
<xsd:schema targetNamespace="http://tests.python-zeep.org/tns">
77-
<xsd:element name="Request" type="xsd:string"/>
78-
<xsd:element name="Response" type="xsd:string"/>
79-
</xsd:schema>
80-
</types>
81-
82-
<message name="Input"/>
83-
<message name="Output">
84-
<part element="tns:Response"/>
85-
</message>
86-
87-
<portType name="TestPortType">
88-
<operation name="TestOperation">
89-
<input message="Input"/>
90-
<output message="Output"/>
91-
</operation>
92-
</portType>
93-
94-
<binding name="TestBinding" type="tns:TestPortType">
95-
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
96-
<operation name="TestOperation">
97-
<soap:operation soapAction=""/>
98-
<input>
99-
<soap:body use="literal"/>
100-
</input>
101-
<output>
102-
<soap:body use="literal"/>
103-
</output>
104-
</operation>
105-
</binding>
106-
</definitions>
107-
""".strip())
108-
109-
root = wsdl.Document(wsdl_content, None)
110-
111-
binding = root.bindings['{http://tests.python-zeep.org/tns}TestBinding']
112-
operation = binding.get('TestOperation')
113-
114-
assert operation.input.body.signature(schema=root.types) == 'soap-env:Body()'
115-
assert operation.input.header.signature(schema=root.types) == 'soap-env:Header()'
116-
assert operation.input.envelope.signature(schema=root.types) == 'soap-env:envelope(body: {})'
117-
assert operation.input.signature(as_output=False) == ''
118-
119-
12068
def test_parse_with_header():
12169
wsdl_content = StringIO("""
12270
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"

tests/test_wsse_signature.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import sys
33

44
import pytest
5-
from lxml import etree
65

76
from tests.utils import load_xml
87
from zeep import wsse

tests/test_xsd_indicators_choice.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,8 @@ def test_choice_with_sequence_change():
770770
element.render(node, elm)
771771
assert_nodes_equal(expected, node)
772772
value = element.parse(node[0], schema)
773+
assert value.item_1 == 'bla-1'
774+
assert value.item_2 == 'bla-2'
773775

774776

775777
def test_choice_with_sequence_change_named():
@@ -815,6 +817,8 @@ def test_choice_with_sequence_change_named():
815817
element.render(node, elm)
816818
assert_nodes_equal(expected, node)
817819
value = element.parse(node[0], schema)
820+
assert value.item_1 == 'bla-1'
821+
assert value.item_2 == 'bla-2'
818822

819823

820824
def test_choice_with_sequence_multiple():

0 commit comments

Comments
 (0)