CimComplianceReport¶
CIMReportGenerator¶
Calculates the statistics of test cases and Creates a MarkDown Report
CIMReportGenerator
¶
Bases: object
Generate the Report. data format::
[
{
"data_model": "A",
"field": "aaa",
"data_set": "AAA",
"tag_stanza": "p",
"status": "pass"/"fail"
}
]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
list
|
List of dictionaries with specified format. |
[]
|
Source code in pytest_splunk_addon/cim_compliance/cim_report_generator.py
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 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
|
add_data(data)
¶
adds data to object property.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
list
|
List of dictionaries with specified format. |
required |
Source code in pytest_splunk_addon/cim_compliance/cim_report_generator.py
79 80 81 82 83 84 85 86 |
|
fail_count(counter)
staticmethod
¶
Function to Get count in Fail/Total format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
counter |
Counter
|
Contains counts of passing/failing Testcases. |
required |
Yields:
Name | Type | Description |
---|---|---|
String |
string with fail/total format. |
Source code in pytest_splunk_addon/cim_compliance/cim_report_generator.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
generate_field_summary_table()
¶
Displays test case summary for all the fields in the dataset for the tag-stanza it is mapped with.
Source code in pytest_splunk_addon/cim_compliance/cim_report_generator.py
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
|
generate_report(report_path)
¶
Function to generate report from the stored data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
report_path |
string
|
Path to create the report. |
required |
Source code in pytest_splunk_addon/cim_compliance/cim_report_generator.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
|
generate_skip_tests_table()
¶
Displays summary of the skipped tests
Source code in pytest_splunk_addon/cim_compliance/cim_report_generator.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
|
generate_summary_table()
¶
Displays test case summary of the add-on for all the supported data models.
Source code in pytest_splunk_addon/cim_compliance/cim_report_generator.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
|
generate_tag_stanza_mapping_table()
¶
Displays test case summary for the stanzas in tags.conf and the dataset mapped with it.
Source code in pytest_splunk_addon/cim_compliance/cim_report_generator.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
pass_count(counter)
staticmethod
¶
Function to Get count in Pass/Total format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
counter |
Counter
|
Contains counts of passing/failing Testcases. |
required |
Yields:
Name | Type | Description |
---|---|---|
String |
string with pass/total format. |
Source code in pytest_splunk_addon/cim_compliance/cim_report_generator.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
MarkDownReport¶
Markdown generator
MarkDownReport
¶
Bases: CIMReport
Generate the markdown content
Source code in pytest_splunk_addon/cim_compliance/markdown_report.py
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 |
|
add_section_description(description)
¶
Adds description string to the section
Parameters:
Name | Type | Description | Default |
---|---|---|---|
description |
str
|
Description string. |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_report.py
49 50 51 52 53 54 55 56 |
|
add_section_note(section_note)
¶
Function to set Note in a report
Parameters:
Name | Type | Description | Default |
---|---|---|---|
section_note |
str
|
String containing note for report. |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_report.py
58 59 60 61 62 63 64 65 |
|
add_section_title(section_title)
¶
Function to add new section to report
Parameters:
Name | Type | Description | Default |
---|---|---|---|
section_title |
str
|
String containing title for new Section. |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_report.py
40 41 42 43 44 45 46 47 |
|
add_table(table_string)
¶
Function to add a table to the Report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table_string |
str
|
Stringified table. |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_report.py
67 68 69 70 71 72 73 74 |
|
set_title(title_string)
¶
Function to set title of a report
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title_string |
str
|
String containing title for report. |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_report.py
31 32 33 34 35 36 37 38 |
|
write(path)
¶
Function to add a table to the Report.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str)
|
path to store report file. |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_report.py
76 77 78 79 80 81 82 83 84 85 86 |
|
MarkDownTable¶
Markdown table generator
MarkdownTable
¶
Bases: BaseTable
Generate table in markdown format
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table_title |
str
|
Title of the table |
required |
header_list |
list(str
|
List of header names |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_table.py
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 |
|
__set_headers(header_list)
¶
Sets the header column for the table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
header_list |
list
|
Contains list of column headers. |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_table.py
47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
__set_title(title)
¶
Adds Title string to the table
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title |
str
|
Title string. |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_table.py
38 39 40 41 42 43 44 45 |
|
add_row(value_list)
¶
Expects a list of row values to be added in the table
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value_list |
list
|
Contains list of row values |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_table.py
70 71 72 73 74 75 76 77 78 79 80 |
|
return_table_str()
¶
Generates the final table str
Source code in pytest_splunk_addon/cim_compliance/markdown_table.py
91 92 93 94 95 96 97 98 99 100 |
|
set_description(description)
¶
Adds description string to the table
Parameters:
Name | Type | Description | Default |
---|---|---|---|
description |
str
|
Description string. |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_table.py
61 62 63 64 65 66 67 68 |
|
set_note(note_str)
¶
It adds the note at the end of the table
Parameters:
Name | Type | Description | Default |
---|---|---|---|
note_str |
str
|
Note string to be added. |
required |
Source code in pytest_splunk_addon/cim_compliance/markdown_table.py
82 83 84 85 86 87 88 89 |
|