示例#1
0
def test_ValidationResultsPageRenderer_render_validation_header(titanic_profiled_evrs_1):
    validation_header = ValidationResultsPageRenderer._render_validation_header(titanic_profiled_evrs_1).to_json_dict()

    expected_validation_header = {
        'content_block_type': 'header',
        'styling': {
            'classes': ['col-12', 'p-0'], 'header': {
                'classes': ['alert', 'alert-secondary']}}, 'header': {'content_block_type': 'string_template',
                                                                      'string_template': {'template': 'Overview',
                                                                                          'tag': 'h5',
                                                                                          'styling': {
                                                                                              'classes': ['m-0']}}},
        'subheader': {'content_block_type': 'string_template', 'string_template': {
            'template': '${suite_title} ${expectation_suite_name}\n${status_title} ${success}',
            'params': {'suite_title': 'Expectation Suite:', 'status_title': 'Status:',
                       'expectation_suite_name': 'default',
                       'success': '<i class="fas fa-times text-danger" aria-hidden="true"></i> Failed'},
            'styling': {'params': {'suite_title': {'classes': ['h6']},
                                   'status_title': {'classes': ['h6']},
                                   'expectation_suite_name': {'tag': 'a', 'attributes': {
                                       'href': '../../../expectations/default.html'}}},
                        'classes': ['mb-0', 'mt-1']}}}}

    # print(validation_header)
    assert validation_header == expected_validation_header
示例#2
0
def test_ValidationResultsPageRenderer_render_validation_header():
    validation_header = {
        "content_block_type": "header",
        "header": "Validation Overview",
        "styling": {
            "classes": ["col-12"],
            "header": {
                "classes": ["alert", "alert-secondary"]
            }
        }
    }
    assert ValidationResultsPageRenderer._render_validation_header() == validation_header
def test_ValidationResultsPageRenderer_render_validation_header(
    titanic_profiled_evrs_1,
):
    validation_header = ValidationResultsPageRenderer._render_validation_header(
        titanic_profiled_evrs_1
    ).to_json_dict()

    expected_validation_header = {
        "content_block_type": "header",
        "styling": {
            "classes": ["col-12", "p-0"],
            "header": {"classes": ["alert", "alert-secondary"]},
        },
        "header": {
            "content_block_type": "string_template",
            "string_template": {
                "template": "Overview",
                "tag": "h5",
                "styling": {"classes": ["m-0"]},
            },
        },
        "subheader": {
            "content_block_type": "string_template",
            "string_template": {
                "template": "${suite_title} ${expectation_suite_name}\n${status_title} ${html_success_icon} ${success}",
                "params": {
                    "suite_title": "Expectation Suite:",
                    "status_title": "Status:",
                    "expectation_suite_name": "default",
                    "success": "Failed",
                    "html_success_icon": '<i class="fas fa-times text-danger" aria-hidden="true"></i>',
                },
                "styling": {
                    "params": {
                        "suite_title": {"classes": ["h6"]},
                        "status_title": {"classes": ["h6"]},
                        "expectation_suite_name": {
                            "tag": "a",
                            "attributes": {
                                "href": "../../../../expectations/default.html"
                            },
                        },
                    },
                    "classes": ["mb-0", "mt-1"],
                },
            },
        },
    }

    # print(validation_header)
    assert validation_header == expected_validation_header