Exemple #1
0
def test_non_html_string(input_string, expected_string, alignment_indicator):
    actual_md = htmltabletomd.convert_table(
        input_string,
        content_conversion_ind=True,
        all_cols_alignment=alignment_indicator,
    )
    assert actual_md == expected_string
Exemple #2
0
def test_missing_tr_tag(input_html, expected_exception, alignment_indicator):
    with pytest.raises(ValueError) as actual_exception:
        actual_md = htmltabletomd.convert_table(
            input_html,
            content_conversion_ind=True,
            all_cols_alignment=alignment_indicator,
        )
    assert expected_exception == str(actual_exception.value)
Exemple #3
0
def test_md_table_conversion(input_html, expected_md):
    assert htmltabletomd.convert_table(input_html) == expected_md
Exemple #4
0
def test_column_alignment(input_html, expected_md, alignment_indicator):
    actual_md = htmltabletomd.convert_table(
        input_html,
        content_conversion_ind=True,
        all_cols_alignment=alignment_indicator)
    assert actual_md == expected_md
Exemple #5
0
def test_newline_pipe_conversion(input_html, expected_md):
    assert (htmltabletomd.convert_table(
        input_html, content_conversion_ind=True) == expected_md)