diff options
author | Petr Viktorin <pviktori@redhat.com> | 2014-10-07 12:48:22 +0200 |
---|---|---|
committer | Tomas Babej <tbabej@redhat.com> | 2014-11-21 12:14:44 +0100 |
commit | 375e9f7c4b855ee8abbab6b5574d54bbd9fb1742 (patch) | |
tree | 88cf59d1736cc9fb3bf23c6a8c63f4c498ebf06a /ipatests/test_ipaserver | |
parent | 7de424f42541e73ed24a95f1dd90ff4a61e111fa (diff) | |
download | freeipa-375e9f7c4b855ee8abbab6b5574d54bbd9fb1742.tar.gz freeipa-375e9f7c4b855ee8abbab6b5574d54bbd9fb1742.tar.xz freeipa-375e9f7c4b855ee8abbab6b5574d54bbd9fb1742.zip |
tests: Use PEP8-compliant setup/teardown method names
The setUp/dearDown names are used in the unittest module, but there is no reason
to use them in non-`unittest` test cases.
Nose supports both styles (but mixing them can cause trouble when
calling super()'s methods).
Pytest only supports the new ones.
https://fedorahosted.org/freeipa/ticket/4610
Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipatests/test_ipaserver')
-rw-r--r-- | ipatests/test_ipaserver/test_changepw.py | 8 | ||||
-rw-r--r-- | ipatests/test_ipaserver/test_ldap.py | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/ipatests/test_ipaserver/test_changepw.py b/ipatests/test_ipaserver/test_changepw.py index 040c9cd36..65bf5a023 100644 --- a/ipatests/test_ipaserver/test_changepw.py +++ b/ipatests/test_ipaserver/test_changepw.py @@ -33,8 +33,8 @@ new_password = u'new_password' class test_changepw(XMLRPC_test, Unauthorized_HTTP_test): app_uri = '/ipa/session/change_password' - def setUp(self): - super(test_changepw, self).setUp() + def setup(self): + super(test_changepw, self).setup() try: api.Command['user_add'](uid=testuser, givenname=u'Test', sn=u'User') api.Command['passwd'](testuser, password=u'old_password') @@ -43,12 +43,12 @@ class test_changepw(XMLRPC_test, Unauthorized_HTTP_test): 'Cannot set up test user: %s' % e ) - def tearDown(self): + def teardown(self): try: api.Command['user_del']([testuser]) except errors.NotFound: pass - super(test_changepw, self).tearDown() + super(test_changepw, self).teardown() def _changepw(self, user, old_password, new_password): return self.send_request(params={'user': str(user), diff --git a/ipatests/test_ipaserver/test_ldap.py b/ipatests/test_ipaserver/test_ldap.py index 46182dbea..8b4e50058 100644 --- a/ipatests/test_ipaserver/test_ldap.py +++ b/ipatests/test_ipaserver/test_ldap.py @@ -44,7 +44,7 @@ class test_ldap(object): Test various LDAP client bind methods. """ - def setUp(self): + def setup(self): self.conn = None self.ldapuri = 'ldap://%s' % ipautil.format_netloc(api.env.host) self.ccache = paths.TMP_KRB5CC % os.getuid() @@ -52,7 +52,7 @@ class test_ldap(object): self.dn = DN(('krbprincipalname','ldap/%s@%s' % (api.env.host, api.env.realm)), ('cn','services'),('cn','accounts'),api.env.basedn) - def tearDown(self): + def teardown(self): if self.conn and self.conn.isconnected(): self.conn.disconnect() @@ -158,14 +158,14 @@ class test_LDAPEntry(object): dn1 = DN(('cn', cn1[0])) dn2 = DN(('cn', cn2[0])) - def setUp(self): + def setup(self): self.ldapuri = 'ldap://%s' % ipautil.format_netloc(api.env.host) self.conn = ldap2(shared_instance=False, ldap_uri=self.ldapuri) self.conn.connect() self.entry = self.conn.make_entry(self.dn1, cn=self.cn1) - def tearDown(self): + def teardown(self): if self.conn and self.conn.isconnected(): self.conn.disconnect() |