From 637d259361306bcbc4af86bbedf17a7ff6875716 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Tue, 20 Jun 2017 10:21:05 +0200 Subject: [PATCH] py3: ipa_otptoken_import: fix hex decoding codecs.decode() must be used instead of .decode() method https://pagure.io/freeipa/issue/4985 Reviewed-By: Stanislav Laznicka --- ipatests/test_ipaserver/test_otptoken_import.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipatests/test_ipaserver/test_otptoken_import.py b/ipatests/test_ipaserver/test_otptoken_import.py index 19dfbf74d..43b334999 100644 --- a/ipatests/test_ipaserver/test_otptoken_import.py +++ b/ipatests/test_ipaserver/test_otptoken_import.py @@ -17,6 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import codecs import os import pytest @@ -62,7 +63,7 @@ class test_otptoken_import(object): def test_figure6(self): doc = PSKCDocument(os.path.join(basename, "pskc-figure6.xml")) assert doc.keyname == 'Pre-shared-key' - doc.setKey('12345678901234567890123456789012'.decode('hex')) + doc.setKey(codecs.decode('12345678901234567890123456789012', 'hex')) assert [(t.id, t.options) for t in doc.getKeyPackages()] == \ [(u'12345678', { 'ipatokenotpkey': u'GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ',