예제 #1
0
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
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
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
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
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
 def test():
     changes = diff(old_html, new_html, cutoff=0.0, pretty=True)
     assert_equal(pretty_changes, changes)
예제 #8
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>")
예제 #9
0
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
 def test():
     assert_equal(diff(old, new, plaintext=True), changes)
예제 #11
0
 def test():
     changes = diff(old_html, new_html, cutoff=0.0, pretty=True)
     assert_equal(pretty_changes, changes)
예제 #12
0
 def test():
     changes = diff(case.old_html, case.new_html, cutoff=0.0)
     assert_html_equal(changes, case.target_changes)
예제 #13
0
 def test():
     assert_equal(diff(old, new, plaintext=True), changes)