Allow text representation of samlp.Status without XML declaration in test.

The xml.etree.ElementTree.tostring() method returns text without
XML declaration in Python 3.
This change amends test in test_12_s_utils to expect the result
with or without XML declaration.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
This commit is contained in:
Oleg Girko
2015-11-05 03:13:42 +00:00
parent 933d53f90e
commit 603b7c5ed9

View File

@@ -106,7 +106,7 @@ def test_status_from_tuple():
def test_status_from_tuple_empty_message(): def test_status_from_tuple_empty_message():
stat = utils.error_status_factory((samlp.STATUS_UNKNOWN_PRINCIPAL, None)) stat = utils.error_status_factory((samlp.STATUS_UNKNOWN_PRINCIPAL, None))
status_text = "%s" % stat status_text = "%s" % stat
assert status_text == ERROR_STATUS_EMPTY assert status_text in (ERROR_STATUS_EMPTY, ERROR_STATUS_NO_HEADER_EMPTY)
def test_attribute_sn(): def test_attribute_sn():