summaryrefslogtreecommitdiffstats
path: root/ipatests/test_ipapython
diff options
context:
space:
mode:
authorMartin Babinsky <mbabinsk@redhat.com>2016-11-28 10:22:26 +0100
committerMartin Babinsky <mbabinsk@redhat.com>2016-11-30 09:40:43 +0100
commit38cc40ddb5bf965801500bb4f66fd965b12e3c88 (patch)
tree967429ee67fdfe740e6bbc9ee2db275f43cf9f81 /ipatests/test_ipapython
parent0e093f938d8126f11fed920b7381ba6e3d07da5b (diff)
downloadfreeipa-38cc40ddb5bf965801500bb4f66fd965b12e3c88.tar.gz
freeipa-38cc40ddb5bf965801500bb4f66fd965b12e3c88.tar.xz
freeipa-38cc40ddb5bf965801500bb4f66fd965b12e3c88.zip
Enhance __repr__ method of Principal
`__repr__` now returns more descriptive string containing the actual principal name while keeping the ability to reconstruct the object from it. This makes principal names visible in debug logs, easing troubleshooting a bit. https://fedorahosted.org/freeipa/ticket/6505 Reviewed-By: Christian Heimes <cheimes@redhat.com>
Diffstat (limited to 'ipatests/test_ipapython')
-rw-r--r--ipatests/test_ipapython/test_kerberos.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ipatests/test_ipapython/test_kerberos.py b/ipatests/test_ipapython/test_kerberos.py
index 7e1eca4d7..284d8c2de 100644
--- a/ipatests/test_ipapython/test_kerberos.py
+++ b/ipatests/test_ipapython/test_kerberos.py
@@ -82,6 +82,8 @@ def test_principals(valid_principal):
assert getattr(princ, name) == value
assert unicode(princ) == principal_name
+ assert repr(princ) == "ipapython.kerberos.Principal('{}')".format(
+ principal_name)
def test_multiple_unescaped_ats_raise_error():