diff options
Diffstat (limited to 'ipatests/test_ipalib')
-rw-r--r-- | ipatests/test_ipalib/test_aci.py | 13 | ||||
-rw-r--r-- | ipatests/test_ipalib/test_backend.py | 11 | ||||
-rw-r--r-- | ipatests/test_ipalib/test_rpc.py | 11 | ||||
-rw-r--r-- | ipatests/test_ipalib/test_text.py | 3 |
4 files changed, 21 insertions, 17 deletions
diff --git a/ipatests/test_ipalib/test_aci.py b/ipatests/test_ipalib/test_aci.py index 40ba5e88c..794d4e82b 100644 --- a/ipatests/test_ipalib/test_aci.py +++ b/ipatests/test_ipalib/test_aci.py @@ -21,13 +21,14 @@ """ Test the `ipalib.aci` module. """ +from __future__ import print_function from ipalib.aci import ACI def check_aci_parsing(source, expected): a = ACI(source) - print 'ACI was: ', a - print 'Expected:', expected + print('ACI was: ', a) + print('Expected:', expected) assert str(ACI(source)) == expected def test_aci_parsing_1(): @@ -76,7 +77,7 @@ def make_test_aci(): def test_aci_equality(): a = make_test_aci() - print a + print(a) b = ACI() b.name ="foo" @@ -85,7 +86,7 @@ def test_aci_equality(): b.set_bindrule_operator("=") b.set_bindrule_expression("\"ldap:///cn=foo,cn=groups,cn=accounts,dc=example,dc=com\"") b.permissions = ['add','read','write'] - print b + print(b) assert a.isequal(b) assert a == b @@ -94,8 +95,8 @@ def test_aci_equality(): def check_aci_inequality(b): a = make_test_aci() - print a - print b + print(a) + print(b) assert not a.isequal(b) assert not a == b diff --git a/ipatests/test_ipalib/test_backend.py b/ipatests/test_ipalib/test_backend.py index 756d434e3..f7887bf64 100644 --- a/ipatests/test_ipalib/test_backend.py +++ b/ipatests/test_ipalib/test_backend.py @@ -20,6 +20,7 @@ """ Test the `ipalib.backend` module. """ +from __future__ import print_function # FIXME: Pylint errors # pylint: disable=no-member @@ -223,11 +224,11 @@ class test_Executioner(ClassChecker): # Test that CommandError is raised: conn = Connection('The connection.', Disconnect('someconn')) context.someconn = conn - print str(list(context.__dict__)) + print(str(list(context.__dict__))) e = raises(errors.CommandError, o.execute, 'nope') assert e.name == 'nope' assert conn.disconnect.called is True # Make sure destroy_context() was called - print str(list(context.__dict__)) + print(str(list(context.__dict__))) assert list(context.__dict__) == [] # Test with echo command: @@ -239,10 +240,10 @@ class test_Executioner(ClassChecker): conn = Connection('The connection.', Disconnect('someconn')) context.someconn = conn - print o.execute('echo', arg1, arg2, **options) - print dict( + print(o.execute('echo', arg1, arg2, **options)) + print(dict( result=(arg1, arg2, options) - ) + )) assert o.execute('echo', arg1, arg2, **options) == dict( result=(arg1, arg2, options) ) diff --git a/ipatests/test_ipalib/test_rpc.py b/ipatests/test_ipalib/test_rpc.py index dd24d055c..5c130bdc6 100644 --- a/ipatests/test_ipalib/test_rpc.py +++ b/ipatests/test_ipalib/test_rpc.py @@ -20,6 +20,7 @@ """ Test the `ipalib.rpc` module. """ +from __future__ import print_function from xmlrpclib import Binary, Fault, dumps, loads @@ -275,7 +276,7 @@ class test_xml_introspection(object): try: result = api.Backend.xmlclient.conn.system.listMethods('foo') except Fault as f: - print f + print(f) assert f.faultCode == 3003 assert f.faultString == ( "command 'system.listMethods' takes no arguments") @@ -295,7 +296,7 @@ class test_xml_introspection(object): try: result = api.Backend.xmlclient.conn.system.methodSignature() except Fault as f: - print f + print(f) assert f.faultCode == 3007 assert f.faultString == "'method name' is required" else: @@ -305,7 +306,7 @@ class test_xml_introspection(object): try: result = api.Backend.xmlclient.conn.system.methodSignature('a', 'b') except Fault as f: - print f + print(f) assert f.faultCode == 3004 assert f.faultString == ( "command 'system.methodSignature' takes at most 1 argument") @@ -316,7 +317,7 @@ class test_xml_introspection(object): try: result = api.Backend.xmlclient.conn.system.methodHelp() except Fault as f: - print f + print(f) assert f.faultCode == 3007 assert f.faultString == "'method name' is required" else: @@ -326,7 +327,7 @@ class test_xml_introspection(object): try: result = api.Backend.xmlclient.conn.system.methodHelp('a', 'b') except Fault as f: - print f + print(f) assert f.faultCode == 3004 assert f.faultString == ( "command 'system.methodHelp' takes at most 1 argument") diff --git a/ipatests/test_ipalib/test_text.py b/ipatests/test_ipalib/test_text.py index c1140d217..c6ab38887 100644 --- a/ipatests/test_ipalib/test_text.py +++ b/ipatests/test_ipalib/test_text.py @@ -20,6 +20,7 @@ """ Test the `ipalib.text` module. """ +from __future__ import print_function import os import shutil @@ -93,7 +94,7 @@ class test_TestLang(object): shutil.rmtree(self.tmp_dir) def test_test_lang(self): - print "test_test_lang" + print("test_test_lang") # The test installs the test message catalog under the xh_ZA # (e.g. Zambia Xhosa) language by default. It would be nice to # use a dummy language not associated with any real language, |