Ejemplo n.º 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>'
    )
Ejemplo n.º 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>',
    )
Ejemplo n.º 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>'
    )
Ejemplo n.º 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>',
    )
Ejemplo n.º 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>',
    )
Ejemplo n.º 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>',
    )
Ejemplo n.º 7
0
 def test():
     changes = diff(old_html, new_html, cutoff=0.0, pretty=True)
     assert_equal(pretty_changes, changes)
Ejemplo n.º 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>")
Ejemplo n.º 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>")
Ejemplo n.º 10
0
 def test():
     assert_equal(diff(old, new, plaintext=True), changes)
Ejemplo n.º 11
0
 def test():
     changes = diff(old_html, new_html, cutoff=0.0, pretty=True)
     assert_equal(pretty_changes, changes)
Ejemplo n.º 12
0
 def test():
     changes = diff(case.old_html, case.new_html, cutoff=0.0)
     assert_html_equal(changes, case.target_changes)
Ejemplo n.º 13
0
 def test():
     assert_equal(diff(old, new, plaintext=True), changes)