コード例 #1
0
ファイル: test_html.py プロジェクト: PolicyStat/htmltreediff
def test_non_printing_characters():
    changes = diff(
        '',
        '<div><p\x01>\x1Ffoo\x21</p>\x00<p>bar</p></div>',
    )
    assert_equal(
        changes,
        '<ins><div><p> foo!</p> <p>bar</p></div></ins>'
    )
コード例 #2
0
ファイル: test_html.py プロジェクト: tex/htmltreediff
def test_other_node_type_inserted():
    changes = diff(
        u'<p>foo</p>',
        u'<p>foo bar</p><?xml version=\'1.0\' encoding=\'utf-8\'?>',
    )
    assert_equal(
        changes,
        '<p>foo<ins> bar</ins></p>',
    )
コード例 #3
0
ファイル: test_html.py プロジェクト: PolicyStat/htmltreediff
def test_non_printing_characters():
    changes = diff(
        '',
        '<div><p\x01>\x1Ffoo\x21</p>\x00<p>bar</p></div>',
    )
    assert_equal(
        changes,
        '<ins><div><p> foo!</p> <p>bar</p></div></ins>'
    )
コード例 #4
0
ファイル: test_html.py プロジェクト: PolicyStat/htmltreediff
def test_other_node_type_inserted():
    changes = diff(
        u'<p>foo</p>',
        u'<p>foo bar</p><?xml version=\'1.0\' encoding=\'utf-8\'?>',
    )
    assert_equal(
        changes,
        '<p>foo<ins> bar</ins></p>',
    )
コード例 #5
0
ファイル: test_html.py プロジェクト: tex/htmltreediff
def test_cutoff():
    changes = diff(
        '<h1>totally</h1>',
        '<h2>different</h2>',
        cutoff=0.2,
    )
    assert_equal(
        changes,
        '<h2>The differences from the previous version are too large to show '
        'concisely.</h2>',
    )
コード例 #6
0
def test_cutoff():
    changes = diff(
        '<h1>totally</h1>',
        '<h2>different</h2>',
        cutoff=0.2,
    )
    assert_equal(
        changes,
        '<h2>The differences from the previous version are too large to show '
        'concisely.</h2>',
    )
コード例 #7
0
ファイル: test_html.py プロジェクト: nomadicfm/htmltreediff
 def test():
     changes = diff(old_html, new_html, cutoff=0.0, pretty=True)
     assert_equal(pretty_changes, changes)
コード例 #8
0
ファイル: test_html.py プロジェクト: nomadicfm/htmltreediff
def test_cutoff():
    changes = diff("<h1>totally</h1>", "<h2>different</h2>", cutoff=0.2)
    assert_equal(changes, "<h2>The differences from the previous version are too large to show " "concisely.</h2>")
コード例 #9
0
ファイル: test_html.py プロジェクト: nomadicfm/htmltreediff
def test_other_node_type_inserted():
    changes = diff(u"<p>foo</p>", u"<p>foo bar</p><?xml version='1.0' encoding='utf-8'?>")
    assert_equal(changes, "<p>foo<ins> bar</ins></p>")
コード例 #10
0
ファイル: test_text.py プロジェクト: archonic/htmltreediff
 def test():
     assert_equal(diff(old, new, plaintext=True), changes)
コード例 #11
0
ファイル: test_html.py プロジェクト: tex/htmltreediff
 def test():
     changes = diff(old_html, new_html, cutoff=0.0, pretty=True)
     assert_equal(pretty_changes, changes)
コード例 #12
0
ファイル: tests.py プロジェクト: PolicyStat/htmltreediff
 def test():
     changes = diff(case.old_html, case.new_html, cutoff=0.0)
     assert_html_equal(changes, case.target_changes)
コード例 #13
0
ファイル: test_text.py プロジェクト: PolicyStat/htmltreediff
 def test():
     assert_equal(diff(old, new, plaintext=True), changes)