Result Manager models
Test Result model¶
TestResult ¶
Bases: BaseModel
Describe the result of a test from a single device.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the device where the test was run. |
test |
str
|
Name of the test run on the device. |
categories |
list[str]
|
List of categories the TestResult belongs to. Defaults to the AntaTest categories. |
description |
str
|
Description of the TestResult. Defaults to the AntaTest description. |
result |
AntaTestStatus
|
Result of the test. Must be one of the AntaTestStatus Enum values: unset, success, failure, error or skipped. |
messages |
list[str]
|
Messages to report after the test, if any. |
custom_field |
str | None
|
Custom field to store a string for flexibility in integrating with ANTA. |
is_error ¶
is_error(message: str | None = None) -> None
Set status to error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str | None
|
Optional message related to the test. |
None
|
Source code in anta/result_manager/models.py
94 95 96 97 98 99 100 101 102 103 |
|
is_failure ¶
is_failure(message: str | None = None) -> None
Set status to failure.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str | None
|
Optional message related to the test. |
None
|
Source code in anta/result_manager/models.py
72 73 74 75 76 77 78 79 80 81 |
|
is_skipped ¶
is_skipped(message: str | None = None) -> None
Set status to skipped.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str | None
|
Optional message related to the test. |
None
|
Source code in anta/result_manager/models.py
83 84 85 86 87 88 89 90 91 92 |
|
is_success ¶
is_success(message: str | None = None) -> None
Set status to success.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str | None
|
Optional message related to the test. |
None
|
Source code in anta/result_manager/models.py
61 62 63 64 65 66 67 68 69 70 |
|