Fix field type to audit_type

There's a number of places where a field of an object is named "type",
which isn't good thing. Actually type is keyword in python, so wherever
I found type used in models/api/object/test, I have fixed it to
audit_type in the audit files

Change-Id: Iea6bd3acb0b2af2a833b3916701aad88f6064bba
Closes-Bug: #1533392
This commit is contained in:
digambar
2016-07-04 22:50:53 +05:30
parent 64903ce56c
commit 47ff9bb105
13 changed files with 29 additions and 29 deletions

View File

@@ -155,7 +155,7 @@ class BaseInfraOptimTest(test.BaseTestCase):
# ### AUDITS ### #
@classmethod
def create_audit(cls, audit_template_uuid, type='ONESHOT',
def create_audit(cls, audit_template_uuid, audit_type='ONESHOT',
state=None, deadline=None):
"""Wrapper utility for creating a test audit
@@ -166,7 +166,7 @@ class BaseInfraOptimTest(test.BaseTestCase):
:return: A tuple with The HTTP response and its body
"""
resp, body = cls.client.create_audit(
audit_template_uuid=audit_template_uuid, type=type,
audit_template_uuid=audit_template_uuid, audit_type=audit_type,
state=state, deadline=deadline)
cls.created_audits.add(body['uuid'])

View File

@@ -41,7 +41,7 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
audit_params = dict(
audit_template_uuid=audit_template['uuid'],
type='ONESHOT',
audit_type='ONESHOT',
)
_, body = self.create_audit(**audit_params)
@@ -57,7 +57,7 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
audit_params = dict(
audit_template_uuid=audit_template['uuid'],
type='CONTINUOUS',
audit_type='CONTINUOUS',
)
_, body = self.create_audit(**audit_params)
@@ -70,7 +70,7 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
def test_create_audit_with_wrong_audit_template(self):
audit_params = dict(
audit_template_uuid='INVALID',
type='ONESHOT',
audit_type='ONESHOT',
)
self.assertRaises(

View File

@@ -58,7 +58,7 @@ class TestCreateDeleteAuditTemplate(base.BaseInfraOptimTest):
@test.attr(type='smoke')
def test_create_audit_template_unicode_description(self):
goal_name = "DUMMY"
goal_name = "dummy"
_, goal = self.client.show_goal(goal_name)
# Use a unicode string for testing:
params = {

View File

@@ -111,7 +111,7 @@ class BaseInfraOptimScenarioTest(manager.ScenarioTest):
# ### AUDITS ### #
def create_audit(self, audit_template_uuid, type='ONESHOT',
def create_audit(self, audit_template_uuid, audit_type='ONESHOT',
state=None, deadline=None):
"""Wrapper utility for creating a test audit
@@ -120,7 +120,7 @@ class BaseInfraOptimScenarioTest(manager.ScenarioTest):
:return: A tuple with The HTTP response and its body
"""
resp, body = self.client.create_audit(
audit_template_uuid=audit_template_uuid, type=type,
audit_template_uuid=audit_template_uuid, audit_type=audit_type,
state=state, deadline=deadline)
self.addCleanup(self.delete_audit, audit_uuid=body["uuid"])