예제 #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>"""