def test_run(self): """Test html_comparator using examples given in mw-api docs.""" with open(join_html_data_path('diff.html')) as filed: diff_html = filed.read() output = html_comparator(diff_html) self.assertEqual( output, {'added-context': ['#REDIRECT [[Template:Unsigned IP]]'], 'deleted-context': [ '<small><span class="autosigned">\\u2014 Preceding ' '[[Wikipedia:Signatures|unsigned]] comment added by ' '[[User:{{{1}}}|{{{1}}}]] ([[User talk:{{{1}}}|talk]] \\u2022 ' '[[Special:Contributions/{{{1}}}|contribs]]) {{{2|}}}</span>' '</small><!-- Template:Unsigned --><noinclude>', '{{documentation}} <!-- add categories to the /doc page, ' 'not here --></noinclude>']})