Report Manager models
ColorManager ¶
Bases: BaseModel
Color management for status report.
Attributes:
| Name | Type | Description |
|---|---|---|
level |
str
|
Test result value. |
color |
str
|
Associated color. |
name_must_be_in ¶
name_must_be_in(v: str) -> str
Status validator
Validate status is a supported one
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v |
str
|
User defined level |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If level is unsupported |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
level value |
Source code in anta/reporter/models.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
string ¶
string() -> str
Build an str with color code
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
String with level and its associated color |
Source code in anta/reporter/models.py
49 50 51 52 53 54 55 56 | |
style_rich ¶
style_rich() -> Text
Build a rich Text syntax with color
Returns:
| Name | Type | Description |
|---|---|---|
Text |
Text
|
object with level string and its associated color. |
Source code in anta/reporter/models.py
40 41 42 43 44 45 46 47 | |
Last update:
July 19, 2023