summaryrefslogtreecommitdiffstats
path: root/ipatests/test_util.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-10-06 15:06:45 +0200
committerMartin Basti <mbasti@redhat.com>2015-10-22 18:34:46 +0200
commitff6613972d233c6b0860f6815846d8ff7f9482a7 (patch)
treededc9932ce1cfd607e032ed8a4a6af672516396c /ipatests/test_util.py
parenteab334dde8e3f94fcf1fca0d111b5121e26c1f4f (diff)
downloadfreeipa-ff6613972d233c6b0860f6815846d8ff7f9482a7.tar.gz
freeipa-ff6613972d233c6b0860f6815846d8ff7f9482a7.tar.xz
freeipa-ff6613972d233c6b0860f6815846d8ff7f9482a7.zip
ipatest.util: Port to Python 3
- Allow bytes or str in Fuzzy - test_util: Fix indices in lists whose elements are unorderable in py3 Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipatests/test_util.py')
-rw-r--r--ipatests/test_util.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipatests/test_util.py b/ipatests/test_util.py
index a0ee7384e..aeb3c93ef 100644
--- a/ipatests/test_util.py
+++ b/ipatests/test_util.py
@@ -113,7 +113,7 @@ class test_Fuzzy(object):
def test_eq(self):
assert (self.klass('bar') == u'foobar') is True
assert (self.klass('^bar') == u'foobar') is False
- assert (self.klass('bar', type=str) == u'foobar') is False
+ assert (self.klass('bar', type=bytes) == u'foobar') is False
assert ('18' == self.klass()) is True
assert ('18' == self.klass(type=int)) is False
@@ -127,7 +127,7 @@ class test_Fuzzy(object):
t = lambda other: other.endswith('bar')
assert (self.klass(test=t) == 'foobar') is True
- assert (self.klass(test=t, type=unicode) == 'foobar') is False
+ assert (self.klass(test=t, type=unicode) == b'foobar') is False
assert (self.klass(test=t) == 'barfoo') is False
assert (False == self.klass()) is True
@@ -186,7 +186,7 @@ def test_assert_deepequal():
]
e = raises(AssertionError, f, a, b, 'foo')
assert str(e) == TYPE % (
- 'foo', unicode, str, u'hello', 'hello', (2,)
+ 'foo', unicode, bytes, u'hello', b'hello', (2 if six.PY2 else 0,)
)
b = [
@@ -206,7 +206,7 @@ def test_assert_deepequal():
]
e = raises(AssertionError, f, a, b, 'foo')
assert str(e) == TYPE % (
- 'foo', int, float, 18, 18.0, (0,)
+ b'foo', int, float, 18, 18.0, (0 if six.PY2 else 2,)
)
# List length mismatch