summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-09-18 17:59:16 +0200
committerTomas Babej <tbabej@redhat.com>2015-10-13 14:16:32 +0200
commitbe876987f527cd9d574f02385ed95e1bd0d5b91b (patch)
treefbdb2c7f39320efd12064c0c7fdeedfaa83405f3 /ipatests
parent88ac1c1616d2dc44fa909a0da49be413660166e6 (diff)
downloadfreeipa-be876987f527cd9d574f02385ed95e1bd0d5b91b.tar.gz
freeipa-be876987f527cd9d574f02385ed95e1bd0d5b91b.tar.xz
freeipa-be876987f527cd9d574f02385ed95e1bd0d5b91b.zip
test_ipalib.test_frontend: Port unbound method tests to Python 3
Python 3 uses plain function objects instead of unbound methods. So, what was Class.method.__func__ is now just Class.method. Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_ipalib/test_frontend.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/ipatests/test_ipalib/test_frontend.py b/ipatests/test_ipalib/test_frontend.py
index d22718c8b..cfa37df69 100644
--- a/ipatests/test_ipalib/test_frontend.py
+++ b/ipatests/test_ipalib/test_frontend.py
@@ -648,7 +648,10 @@ class test_Command(ClassChecker):
(api, home) = create_test_api(in_server=True)
api.finalize()
o = my_cmd(api)
- assert o.run.__func__ is self.cls.run.__func__
+ if six.PY2:
+ assert o.run.__func__ is self.cls.run.__func__
+ else:
+ assert o.run.__func__ is self.cls.run
out = o.run(*args, **kw)
assert ('execute', args, kw) == out
@@ -656,7 +659,10 @@ class test_Command(ClassChecker):
(api, home) = create_test_api(in_server=False)
api.finalize()
o = my_cmd(api)
- assert o.run.__func__ is self.cls.run.__func__
+ if six.PY2:
+ assert o.run.__func__ is self.cls.run.__func__
+ else:
+ assert o.run.__func__ is self.cls.run
assert ('forward', args, kw) == o.run(*args, **kw)
def test_messages(self):
@@ -688,14 +694,20 @@ class test_Command(ClassChecker):
(api, home) = create_test_api(in_server=True)
api.finalize()
o = my_cmd(api)
- assert o.run.__func__ is self.cls.run.__func__
+ if six.PY2:
+ assert o.run.__func__ is self.cls.run.__func__
+ else:
+ assert o.run.__func__ is self.cls.run
assert {'name': 'execute', 'messages': expected} == o.run(*args, **kw)
# Test in non-server context
(api, home) = create_test_api(in_server=False)
api.finalize()
o = my_cmd(api)
- assert o.run.__func__ is self.cls.run.__func__
+ if six.PY2:
+ assert o.run.__func__ is self.cls.run.__func__
+ else:
+ assert o.run.__func__ is self.cls.run
assert {'name': 'forward', 'messages': expected} == o.run(*args, **kw)
def test_validate_output_basic(self):