コード例 #1
0
def test_parse_comment_html():
    """Parse an HTML comment."""
    text = cleandoc("""
        <!--
        Hello
        world
        -->
        """)
    expected = cleandoc("""
        Hello
        world
        """)

    assert HtmlCommentStyle.parse_comment(text) == expected
コード例 #2
0
def test_create_comment_html_single():
    """Creating a single-line HTML comment fails."""
    with pytest.raises(CommentCreateError):
        HtmlCommentStyle._create_comment_single("hello")
コード例 #3
0
def test_parse_comment_html_single_line():
    """Parse a single-line HTML comment."""
    text = "<!-- Hello world -->"
    expected = "Hello world"

    assert HtmlCommentStyle.parse_comment(text) == expected