Skip to content

Commit b928d81

Browse files
committed
Fix test failing due to optimized out xml
Somewhere between python2.7 and python3.4 etree started dropping the xml header when defaults will suffice. This test was relying on it being there.
1 parent 3259e58 commit b928d81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_42_enc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
__author__ = 'roland'
1111

12-
TMPL = """<?xml version='1.0' encoding='UTF-8'?>
13-
<ns0:EncryptedData xmlns:ns0="http://www.w3.org/2001/04/xmlenc#" xmlns:ns1="http://www.w3.org/2000/09/xmldsig#" Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element"><ns0:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" /><ns1:KeyInfo><ns0:EncryptedKey Id="EK"><ns0:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" /><ns1:KeyInfo><ns1:KeyName>my-rsa-key</ns1:KeyName></ns1:KeyInfo><ns0:CipherData><ns0:CipherValue /></ns0:CipherData></ns0:EncryptedKey></ns1:KeyInfo><ns0:CipherData><ns0:CipherValue /></ns0:CipherData></ns0:EncryptedData>"""
12+
TMPL_NO_HEADER = """<ns0:EncryptedData xmlns:ns0="http://www.w3.org/2001/04/xmlenc#" xmlns:ns1="http://www.w3.org/2000/09/xmldsig#" Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element"><ns0:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" /><ns1:KeyInfo><ns0:EncryptedKey Id="EK"><ns0:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" /><ns1:KeyInfo><ns1:KeyName>my-rsa-key</ns1:KeyName></ns1:KeyInfo><ns0:CipherData><ns0:CipherValue /></ns0:CipherData></ns0:EncryptedKey></ns1:KeyInfo><ns0:CipherData><ns0:CipherValue /></ns0:CipherData></ns0:EncryptedData>"""
13+
TMPL = "<?xml version='1.0' encoding='UTF-8'?>\n%s" % TMPL_NO_HEADER
1414

1515
IDENTITY = {"eduPersonAffiliation": ["staff", "member"],
1616
"surName": ["Jeter"], "givenName": ["Derek"],
@@ -27,7 +27,7 @@
2727
def test_pre_enc():
2828
tmpl = pre_encryption_part()
2929
print(tmpl)
30-
assert "%s" % tmpl == TMPL
30+
assert "%s" % tmpl in (TMPL_NO_HEADER, TMPL)
3131

3232

3333
def test_reshuffle_response():

0 commit comments

Comments
 (0)