Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 7 additions & 18 deletions test/integration/plugins/test_quota.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
try:
cleanup_resources(cls.apiclient, cls._cleanup)
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
super(TestQuota, cls).tearDownClass()

def setUp(self):
self.apiclient = self.testClient.getApiClient()
Expand All @@ -73,12 +69,7 @@ def setUp(self):
return

def tearDown(self):
try:
#Clean up, terminate the created templates
cleanup_resources(self.apiclient, self.cleanup)
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
super(TestQuota, self).tearDown()

#Check quotaTariffList API returning 22 items
@attr(tags=["smoke", "advanced"], required_hardware="false")
Expand Down Expand Up @@ -244,10 +235,9 @@ def test_06_quota(self):
cmd.startdate = today
response = self.apiclient.quotaBalance(cmd)

self.debug("Quota Balance on: %s" % response.startdate)
self.debug("is: %s" % response.startquota)
self.debug(f"Quota Balance: {response.balance}")

self.assertEqual( response.startquota, 10)
self.assertEqual( response.startquota, 0, f"startQuota is supposed to be 0 but was {response.balance.startquota}")
return

#make credit deposit and check start and end date balances
Expand All @@ -267,9 +257,8 @@ def test_07_quota(self):
cmd.enddate = today
response = self.apiclient.quotaBalance(cmd)

self.debug("Quota Balance on: %s" % response.startdate)
Comment thread
DaanHoogland marked this conversation as resolved.
self.debug("is: %s" % response.startquota)
self.debug("Quota Balance: {response.balance}")

self.assertEqual( response.startquota, 0)
self.assertEqual( response.endquota, 10)
self.assertEqual( response.balance.startquota, 0, f"startquota was supposed to be 0 but was {response.balance.startquota}")
self.assertEqual( response.balance.endquota, 10, f"endquota was supposed to be 10 but was {response.balance.endquota}")
return