CSV Reporter
CSV Report management for ANTA.
ReportCsv ¶
Build a CSV report.
Headers
dataclass
¶
Headers(
device: str = "Device",
test_name: str = "Test Name",
test_status: str = "Test Status",
messages: str = "Message(s)",
description: str = "Test description",
categories: str = "Test category",
)
Headers for the CSV report.
convert_to_list
classmethod
¶
convert_to_list(result: TestResult) -> list[str]
Convert a TestResult into a list of string for creating file content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result |
TestResult
|
A TestResult to convert into list. |
required |
Returns:
Type | Description |
---|---|
list[str]
|
TestResult converted into a list. |
Source code in anta/reporter/csv_reporter.py
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 |
|
generate
classmethod
¶
generate(
results: ResultManager, csv_filename: pathlib.Path
) -> None
Build CSV flle with tests results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
results |
ResultManager
|
A ResultManager instance. |
required |
csv_filename |
Path
|
File path where to save CSV data. |
required |
Raises:
Type | Description |
---|---|
OSError
|
if any is raised while writing the CSV file. |
Source code in anta/reporter/csv_reporter.py
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 |
|
split_list_to_txt_list
classmethod
¶
split_list_to_txt_list(
usr_list: list[str], delimiter: str = " - "
) -> str
Split list to multi-lines string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
usr_list |
list[str]
|
List of string to concatenate. |
required |
delimiter |
str
|
A delimiter to use to start string. Defaults to None. |
' - '
|
Returns:
Type | Description |
---|---|
str
|
Multi-lines string. |
Source code in anta/reporter/csv_reporter.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|