From d17a898fcfb9943d4f7ad0ed719cc829f4a1ab12 Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Tue, 13 Mar 2012 01:48:41 -0700 Subject: [PATCH] Fix closes Issue14281 - Test for cgi.escape by Brian Landers --- Lib/test/test_cgi.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index 63547b24c20..f6abe976cf7 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -120,6 +120,11 @@ def gen_result(data, environ): class CgiTests(unittest.TestCase): + def test_escape(self): + self.assertEqual("test & string", cgi.escape("test & string")) + self.assertEqual("<test string>", cgi.escape("")) + self.assertEqual(""test string"", cgi.escape('"test string"', True)) + def test_strict(self): for orig, expect in parse_strict_test_cases: # Test basic parsing