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