test_case
TestCase defines structure for all tests to be defined for a TestSuite.
TestCase
Bases: Serializable
Class that contains all information about a test case.
Source code in mlte/suite/test_case.py
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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
goal = goal
instance-attribute
Goal for the TestCase, reason for it.
identifier = identifier
instance-attribute
Unique id or name given to the test case.
measurement = measurement
instance-attribute
Used to measure and get a value for this test case.
note = note
instance-attribute
Additional information to go along with this test case.
quality_scenarios = quality_scenarios.copy()
instance-attribute
Quality Attribute Scenario ids that are associated to this test case.
validator = validator
instance-attribute
Used to validate this test case.
__eq__(other)
Test instance for equality.
Source code in mlte/suite/test_case.py
152 153 154 155 156 157 158 159 160 161 162 163 164 | |
__str__()
Return a string representation of TestCase.
Source code in mlte/suite/test_case.py
148 149 150 | |
from_model(model)
classmethod
Deserialize a TestCase from a model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
BaseModel
|
The model. |
required |
Returns:
| Type | Description |
|---|---|
TestCase
|
The deserialized TestCase |
Source code in mlte/suite/test_case.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
measure(*args, **kwargs)
Executes the configured measurement with the given params.
Source code in mlte/suite/test_case.py
52 53 54 55 56 57 58 59 | |
to_model()
Returns this test case as a model.
Returns:
| Type | Description |
|---|---|
TestCaseModel
|
The serialized model object. |
Source code in mlte/suite/test_case.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
to_template_str()
Convert the test case into a template string.
Source code in mlte/suite/test_case.py
136 137 138 139 140 141 142 | |
validate(evidence)
Executes the configured validator with the given Evidence.
Source code in mlte/suite/test_case.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |