Skip to content

Commit

Permalink
reformat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanHoogland committed Apr 26, 2024
1 parent 0b7e828 commit e1e6a90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
7 changes: 1 addition & 6 deletions test/integration/component/test_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
try:
cleanup_resources(cls.api_client, cls._cleanup)

except Exception as tde:
raise Exception("Warning: Exception during cleanup : %s" % tde)
return
super(TestLdap, cls).tearDownClass()

def setUp(self):

Expand Down
20 changes: 9 additions & 11 deletions test/integration/plugins/ldap/test_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ def setUpClass(cls):
def tearDownClass(cls):
cls.logger.info("Tearing Down Class")
try:
cleanup_resources(cls.apiclient, reversed(cls._cleanup))
cls.remove_ldap_configuration_for_domains()
cls.logger.debug("done cleaning up resources in tearDownClass(cls) %s")
except Exception as e:
cls.logger.debug("Exception in tearDownClass(cls): %s" % e)
super(TestLDAP, cls).tearDownClass()
finally:
try:
cls.remove_ldap_configuration_for_domains()
cls.logger.debug("done cleaning up resources in tearDownClass(cls) %s")
except Exception as e:
cls.logger.debug("Exception in tearDownClass(cls): %s" % e)

def setUp(self):
self.cleanup = []
Expand All @@ -116,11 +118,7 @@ def setUp(self):
return

def tearDown(self):
try:
cleanup_resources(self.apiclient, self.cleanup)
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
super(TestLDAP, self).tearDown()

@attr(tags=["smoke", "advanced"], required_hardware="false")
def test_01_manual(self):
Expand Down Expand Up @@ -349,8 +347,8 @@ def create_domain(cls, domain_to_create, parent_domain = None):
if parent_domain:
domain_to_create["parentdomainid"] = parent_domain
tmpDomain = Domain.create(cls.apiclient, domain_to_create)
cls.logger.debug("Created domain %s with id %s " % (tmpDomain.name, tmpDomain.id))
cls._cleanup.append(tmpDomain)
cls.logger.debug("Created domain %s with id %s " % (tmpDomain.name, tmpDomain.id))
return tmpDomain

@classmethod
Expand Down

0 comments on commit e1e6a90

Please sign in to comment.