summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/models/testcase_models.py
blob: d1b8877f7f1bbf204c889db5977de51287229b01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
##############################################################################
# Copyright (c) 2015 Orange
# guyrodrigue.koffi@orange.com / koffirodrigue@gmail.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
from opnfv_testapi.models import base_models
from opnfv_testapi.tornado_swagger import swagger


@swagger.model()
class TestcaseCreateRequest(base_models.ModelBase):
    def __init__(self, name, url=None, description=None,
                 catalog_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.catalog_description = catalog_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"


@swagger.model()
class TestcaseUpdateRequest(base_models.ModelBase):
    def __init__(self, name=None, description=None, project_name=None,
                 catalog_description=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.catalog_description = catalog_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


@swagger.model()
class Testcase(base_models.ModelBase):
    def __init__(self, _id=None, name=None, project_name=None,
                 description=None, url=None, creation_date=None,
                 catalog_description=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.catalog_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


@swagger.model()
class Testcases(base_models.ModelBase):
    """
        @property testcases:
        @ptype testcases: C{list} of L{Testcase}
    """
    def __init__(self):
        self.testcases = list()

    @staticmethod
    def attr_parser():
        return {'testcases': Testcase}