From 603b7c5ed9345d127377b43e6094ec70e23a6dd2 Mon Sep 17 00:00:00 2001
From: Oleg Girko
Date: Thu, 5 Nov 2015 03:13:42 +0000
Subject: [PATCH] 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
---
tests/test_12_s_utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_12_s_utils.py b/tests/test_12_s_utils.py
index b03ad1b..ca53003 100644
--- a/tests/test_12_s_utils.py
+++ b/tests/test_12_s_utils.py
@@ -106,7 +106,7 @@ def test_status_from_tuple():
def test_status_from_tuple_empty_message():
stat = utils.error_status_factory((samlp.STATUS_UNKNOWN_PRINCIPAL, None))
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():