From 6607990608ee908c288ad96b75198eb19f5cd909 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Fri, 9 Dec 2016 16:04:20 +0100 Subject: Update testcase model for Test DB JIRA: FUNCTEST-587 Change-Id: I8473cf5df181197a16920f507aff2a5c00dc332e Signed-off-by: Morgan Richomme --- .../opnfv_testapi/resources/testcase_models.py | 88 +++++++++++++++++++++- 1 file changed, 84 insertions(+), 4 deletions(-) (limited to 'utils/test/testapi/opnfv_testapi') diff --git a/utils/test/testapi/opnfv_testapi/resources/testcase_models.py b/utils/test/testapi/opnfv_testapi/resources/testcase_models.py index e1f2fb650..0ed705f0f 100644 --- a/utils/test/testapi/opnfv_testapi/resources/testcase_models.py +++ b/utils/test/testapi/opnfv_testapi/resources/testcase_models.py @@ -11,10 +11,23 @@ from opnfv_testapi.tornado_swagger import swagger @swagger.model() class TestcaseCreateRequest(object): - def __init__(self, name, url=None, description=None): + def __init__(self, name, url=None, description=None, + tier=None, ci_loop=None, criteria=None, + blocking=None, dependencies=None, run=None, + domains=None, tags=None, version=None): self.name = name self.url = url self.description = description + self.tier = tier + self.ci_loop = ci_loop + self.criteria = criteria + self.blocking = blocking + self.dependencies = dependencies + self.run = run + self.domains = domains + self.tags = tags + self.version = version + self.trust = "Silver" def format(self): return { @@ -26,29 +39,66 @@ class TestcaseCreateRequest(object): @swagger.model() class TestcaseUpdateRequest(object): - def __init__(self, name=None, description=None, project_name=None): + def __init__(self, name=None, description=None, project_name=None, + tier=None, ci_loop=None, criteria=None, + blocking=None, dependencies=None, run=None, + domains=None, tags=None, version=None, trust=None): self.name = name self.description = description self.project_name = project_name + self.tier = tier + self.ci_loop = ci_loop + self.criteria = criteria + self.blocking = blocking + self.dependencies = dependencies + self.run = run + self.domains = domains + self.tags = tags + self.version = version + self.trust = trust def format(self): return { "name": self.name, "description": self.description, "project_name": self.project_name, + "tier": self.tier, + "ci_loop": self.ci_loop, + "criteria": self.criteria, + "blocking": self.blocking, + "dependencies": self.dependencies, + "run": self.run, + "domains": self.domains, + "tags": self.tags, + "version": self.version, + "trust": self.trust } @swagger.model() class Testcase(object): def __init__(self, _id=None, name=None, project_name=None, - description=None, url=None, creation_date=None): + description=None, url=None, creation_date=None, + tier=None, ci_loop=None, criteria=None, + blocking=None, dependencies=None, run=None, + domains=None, tags=None, version=None, + trust=None): self._id = None self.name = None self.project_name = None self.description = None self.url = None self.creation_date = None + self.tier=None + self.ci_loop=None + self.criteria=None + self.blocking=None + self.dependencies=None + self.run=None + self.domains=None + self.tags=None + self.version=None + self.trust=None @staticmethod def from_dict(a_dict): @@ -63,6 +113,16 @@ class Testcase(object): t.name = a_dict.get('name') t.description = a_dict.get('description') t.url = a_dict.get('url') + t.tier = a_dict.get('tier') + t.ci_loop = a_dict.get('ci_loop') + t.criteria = a_dict.get('criteria') + t.blocking = a_dict.get('blocking') + t.dependencies = a_dict.get('dependencies') + t.run = a_dict.get('run') + t.domains = a_dict.get('domains') + t.tags = a_dict.get('tags') + t.version = a_dict.get('version') + t.trust = a_dict.get('trust') return t @@ -72,7 +132,17 @@ class Testcase(object): "description": self.description, "project_name": self.project_name, "creation_date": str(self.creation_date), - "url": self.url + "url": self.url, + "tier": self.tier, + "ci_loop": self.ci_loop, + "criteria": self.criteria, + "blocking": self.blocking, + "dependencies": self.dependencies, + "run": self.run, + "domains": self.domains, + "tags": self.tags, + "version": self.version, + "trust": self.trust } def format_http(self): @@ -83,6 +153,16 @@ class Testcase(object): "description": self.description, "creation_date": str(self.creation_date), "url": self.url, + "tier": self.tier, + "ci_loop": self.ci_loop, + "criteria": self.criteria, + "blocking": self.blocking, + "dependencies": self.dependencies, + "run": self.run, + "domains": self.domains, + "tags": self.tags, + "version": self.version, + "trust": self.trust } -- cgit 1.2.3-korg