Eine Menge Aufräumarbeiten.
* Eine Testsuite um Mahrjong Ranking Berechnungen zu testen * Erste Arbeiten um die Workarounds aus dem "utils" Paket los zu werden. * Vieles am Code umformatiert für PEP8 conformität
This commit is contained in:
@@ -5,7 +5,8 @@ import html_cleaner
|
||||
class HtmlTestCase(unittest.TestCase):
|
||||
known_html = (
|
||||
('<STRONG>Fett!</STRONG>', '<strong>Fett!</strong>'),
|
||||
('<a href="link.html" onclick="do_evil()">Bad Link</a>', '<a href="link.html">Bad Link</a>'),
|
||||
('<a href="link.html" onclick="do_evil()">Bad Link</a>',
|
||||
'<a href="link.html">Bad Link</a>'),
|
||||
('''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML><HEAD>
|
||||
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
|
||||
@@ -32,8 +33,8 @@ class HtmlTestCase(unittest.TestCase):
|
||||
href="http://www.xxxxxxxxxxxx.com">http://www.xxxxxxxxxxxx.com</A><BR>(xxx)
|
||||
xxx-xxxx</FONT></DIV></BODY></HTML>
|
||||
''',
|
||||
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'
|
||||
)
|
||||
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'
|
||||
)
|
||||
)
|
||||
|
||||
def test_html_cleaner(self):
|
||||
@@ -42,5 +43,6 @@ class HtmlTestCase(unittest.TestCase):
|
||||
for original, tidy in self.known_html:
|
||||
self.assertEqual(cleaner.clean_html(original), tidy)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user