mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
committed by
Tomas Babej
parent
7de424f425
commit
375e9f7c4b
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user