示例#1
0
文件: test_html.py 项目: uyar/piculet
def test_html_to_xhtml_ampersands_should_be_replaced_in_attribute_values():
    content = """<html><p id="&"></p></html>"""
    normalized = html_to_xhtml(content)
    assert normalized == """<html><p id="&amp;"></p></html>"""
示例#2
0
文件: test_html.py 项目: uyar/piculet
def test_html_to_xhtml_quotes_should_be_replaced_in_attribute_values():
    content = """<html><p id="&#x22;"></p></html>"""
    normalized = html_to_xhtml(content)
    assert normalized == """<html><p id="&quot;"></p></html>"""
示例#3
0
文件: test_html.py 项目: uyar/piculet
def test_html_to_xhtml_ampersands_should_be_replaced_in_data():
    content = """<html><p>&</p></html>"""
    normalized = html_to_xhtml(content)
    assert normalized == """<html><p>&amp;</p></html>"""
示例#4
0
文件: test_html.py 项目: uyar/piculet
def test_html_to_xhtml_gts_should_be_replaced_in_data():
    content = """<html><p>></p></html>"""
    normalized = html_to_xhtml(content)
    assert normalized == """<html><p>&gt;</p></html>"""
示例#5
0
文件: test_html.py 项目: uyar/piculet
def test_html_to_xhtml_self_closing_tags_should_not_have_closing_tags():
    content = """<html><br/></html>"""
    normalized = html_to_xhtml(content)
    assert normalized == """<html><br/></html>"""
示例#6
0
文件: test_html.py 项目: uyar/piculet
def test_html_to_xhtml_attributes_should_have_values():
    content = """<html><option checked></option></html>"""
    normalized = html_to_xhtml(content)
    assert normalized == """<html><option checked=""></option></html>"""
示例#7
0
文件: test_html.py 项目: uyar/piculet
def test_html_to_xhtml_comment_should_be_removed():
    content = """<html><!-- comment --></html>"""
    normalized = html_to_xhtml(content)
    assert normalized == """<html></html>"""
示例#8
0
文件: test_html.py 项目: uyar/piculet
def test_html_to_xhtml_doctype_should_be_removed():
    content = """<!DOCTYPE html><html></html>"""
    normalized = html_to_xhtml(content)
    assert normalized == """<html></html>"""
示例#9
0
文件: test_html.py 项目: uyar/piculet
def test_html_to_xhtml_well_formed_xml_should_succeed():
    content = """<html></html>"""
    normalized = html_to_xhtml(content)
    assert normalized == """<html></html>"""
示例#10
0
文件: test_html.py 项目: uyar/piculet
def test_html_to_xhtml_unicode_attribute_value_should_be_preserved():
    content = """<html><p foo="ğış"></p></html>"""
    normalized = html_to_xhtml(content)
    assert normalized == """<html><p foo="ğış"></p></html>"""
示例#11
0
文件: test_html.py 项目: uyar/piculet
def test_html_to_xhtml_unicode_data_should_be_preserved():
    content = """<html><p>ğış</p></html>"""
    normalized = html_to_xhtml(content)
    assert normalized == """<html><p>ğış</p></html>"""