Skip to content

Commit 4715b04

Browse files
3bhmvantellingen
authored andcommitted
Test to cover signing the WSSE timestamp
1 parent a9f767d commit 4715b04

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/test_wsse_signature.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,34 @@
2626
)
2727

2828

29+
@skip_if_no_xmlsec
30+
def test_sign_timestamp_if_present():
31+
envelope = load_xml(
32+
"""
33+
<soapenv:Envelope
34+
xmlns:tns="http://tests.python-zeep.org/"
35+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
36+
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
37+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
38+
xmlns:wsu="http://schemas.xmlsoap.org/ws/2003/06/utility">
39+
<soapenv:Header>
40+
<wsu:Timestamp>
41+
<wsu:Created>2018-11-18T15:44:27Z</wsu:Created>
42+
<wsu:Expires>2018-11-18T15:54:27Z</wsu:Expires>
43+
</wsu:Timestamp>
44+
</soapenv:Header>
45+
<soapenv:Body>
46+
<tns:Function>
47+
<tns:Argument>OK</tns:Argument>
48+
</tns:Function>
49+
</soapenv:Body>
50+
</soapenv:Envelope>
51+
"""
52+
)
53+
54+
signature.sign_envelope(envelope, KEY_FILE, KEY_FILE)
55+
signature.verify_envelope(envelope, KEY_FILE)
56+
2957
@skip_if_no_xmlsec
3058
def test_sign():
3159
envelope = load_xml(

0 commit comments

Comments
 (0)