Report Manager models
ColorManager Entry¶
Bases: BaseModel
Color mangement for status report.
Attributes:
Name | Type | Description |
---|---|---|
level |
str
|
Test result value. |
color |
str
|
Associated color. |
Source code in anta/reporter/models.py
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 |
|
name_must_be_in(v)
¶
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
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
string()
¶
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
48 49 50 51 52 53 54 55 |
|
style_rich()
¶
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
39 40 41 42 43 44 45 46 |
|
Last update:
April 6, 2023