Added tests for html tools.

This commit is contained in:
Andrew Hamilton 2016-02-09 21:38:33 +00:00
parent fb93897ac7
commit 60a99ee705
5 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,4 @@
<html>
<head></head>
<body>hello</body>
</html>

View file

@ -0,0 +1 @@
hello

View file

@ -0,0 +1,11 @@
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
line 2 column 3 - Warning: inserting missing 'title' element
Info: Document content looks like HTML 3.2
2 warnings, 0 errors were found!
To learn more about HTML Tidy see http://tidy.sourceforge.net
Please fill bug reports and queries using the "tracker" on the Tidy web site.
Additionally, questions can be sent to html-tidy@w3.org
HTML and CSS specifications are available from http://www.w3.org/
Lobby your company to join W3C, see http://www.w3.org/Consortium

View file

@ -0,0 +1,11 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org">
<title></title>
</head>
<body>
hello
</body>
</html>

View file

@ -129,6 +129,18 @@ class ToolsTestCase(unittest.TestCase):
self._sub_tests([(tools.splint, "hello.c", tools.Status.ok),
(tools.splint, "hello.h", tools.Status.ok)])
def test_html_syntax(self):
self._sub_tests([
(tools.html_syntax, "hi.html", tools.Status.problem)])
def test_tidy(self):
self._sub_tests([
(tools.tidy, "hi.html", tools.Status.normal)])
def test_html2text(self):
self._sub_tests([
(tools.html2text, "hi.html", tools.Status.normal)])
if __name__ == "__main__":
golden.main()