コード例 #1
0
 def test_multiple_files(self):
     """
     Test validation of multiple files.
     """
     self.assertListEqual(
         validate(["test_no_errors.html", "test_basic_errors.html"]),
         broken_file_errors)
コード例 #2
0
 def test_error_string_with_quotes(self):
     """
     Test a file with errors containing colon, to make sure it doesn't mess up parsing.
     """
     self.assertEqual(len(validate("test_basic_errors_with_colon.html")), 3)
コード例 #3
0
 def test_basic_errors(self):
     """
     Test a file with some errors.
     """
     self.assertListEqual(validate(["test_basic_errors.html"]),
                          broken_file_errors)
コード例 #4
0
 def test_missing_file_exception(self):
     """
     Test validation of a missing file (exception).
     """
     self.assertRaises(MissingHtmlFile, lambda: validate("not_exist.html"))
コード例 #5
0
 def test_ok_file(self):
     """
     Test validation of file with no errors.
     """
     self.assertListEqual(validate("test_no_errors.html"), [])
コード例 #6
0
ファイル: test.py プロジェクト: kindkaktus/htmlvalidator
 def test_validate_bad_html_document_with_filter(self):
     errors = validate('http://blog.tjll.net/ssh-kung-fu/', error_ignore_regex=re.compile(u"(Bad value “only screen|“&” did not start a character reference|Element “(a|li)” not allowed|The “itemprop” attribute was specified).*", re.DOTALL))
     self.assertEquals(len(errors), 0)
コード例 #7
0
ファイル: test.py プロジェクト: kindkaktus/htmlvalidator
 def test_validate_bad_html_document(self):
     errors = validate('http://blog.tjll.net/ssh-kung-fu/')
     self.assertGreater(len(errors), 0)
コード例 #8
0
ファイル: test.py プロジェクト: kindkaktus/htmlvalidator
 def test_validate_good_html_document(self):
     errors = validate('http://www.ibooksmart.com')
     self.assertEquals(len(errors), 0)