Пример #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)