Georg Brandl | 1f7fffb | 2010-10-15 15:57:45 +0000 | [diff] [blame] | 1 | """ |
| 2 | Tests for the html module functions. |
| 3 | """ |
| 4 | |
| 5 | import html |
| 6 | import unittest |
| 7 | from test.support import run_unittest |
| 8 | |
| 9 | |
| 10 | class HtmlTests(unittest.TestCase): |
| 11 | def test_escape(self): |
| 12 | self.assertEqual( |
| 13 | html.escape('\'<script>"&foo;"</script>\''), |
| 14 | ''<script>"&foo;"</script>'') |
| 15 | self.assertEqual( |
| 16 | html.escape('\'<script>"&foo;"</script>\'', False), |
| 17 | '\'<script>"&foo;"</script>\'') |
| 18 | |
| 19 | |
| 20 | def test_main(): |
| 21 | run_unittest(HtmlTests) |
| 22 | |
| 23 | if __name__ == '__main__': |
| 24 | test_main() |