def test_ValidationResultsTableContentBlockRenderer_get_content_block_fn( evr_success): content_block_fn = ValidationResultsTableContentBlockRenderer._get_content_block_fn( "expect_table_row_count_to_be_between") content_block_fn_output = content_block_fn(evr_success) content_block_fn_expected_output = [[ RenderedStringTemplateContent( **{ "content_block_type": "string_template", "string_template": { "template": "$icon", "params": { "icon": "", "markdown_status_icon": "✅" }, "styling": { "params": { "icon": { "classes": [ "fas", "fa-check-circle", "text-success", ], "tag": "i", } } }, }, "styling": { "parent": { "classes": ["hide-succeeded-validation-target-child"] } }, }), RenderedStringTemplateContent( **{ "content_block_type": "string_template", "string_template": { "template": "Must have greater than or equal to $min_value rows.", "params": { "min_value": 0, "max_value": None, "result_format": "SUMMARY", "row_condition": None, "condition_parser": None, "strict_max": None, "strict_min": None, }, "styling": None, }, }), "1,313", ]] assert content_block_fn_output == content_block_fn_expected_output
def test_ValidationResultsTableContentBlockRenderer_get_content_block_fn(evr_success): content_block_fn = ValidationResultsTableContentBlockRenderer._get_content_block_fn("expect_table_row_count_to_be_between") content_block_fn_output = content_block_fn(evr_success) print(json.dumps(content_block_fn_output, indent=2)) content_block_fn_expected_output = [ [ { "content_block_type": "string_template", "string_template": { "template": "$icon", "params": { "icon": "" }, "styling": { "params": { "icon": { "classes": [ "fas", "fa-check-circle", "text-success" ], "tag": "i" } } } } }, { "content_block_type": "string_template", "string_template": { "template": "Must have more than $min_value rows.", "params": { "min_value": 0, "max_value": None, "result_format": "SUMMARY" }, "styling": None } }, "1313" ] ] assert content_block_fn_output == content_block_fn_expected_output