summaryrefslogtreecommitdiff
path: root/Lib/test/test_cgi.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-03-13 01:48:41 -0700
committerSenthil Kumaran <senthil@uthcode.com>2012-03-13 01:48:41 -0700
commitd17a898fcfb9943d4f7ad0ed719cc829f4a1ab12 (patch)
tree257ace055009258f3f30ebca90e9f887a48fd88a /Lib/test/test_cgi.py
parentb968b36ad0b46bf7a909afffb3b558ed5aeebfe0 (diff)
downloadcpython-git-d17a898fcfb9943d4f7ad0ed719cc829f4a1ab12.tar.gz
Fix closes Issue14281 - Test for cgi.escape by Brian Landers
Diffstat (limited to 'Lib/test/test_cgi.py')
-rw-r--r--Lib/test/test_cgi.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py
index 63547b24c2..f6abe976cf 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 &amp; string", cgi.escape("test & string"))
+ self.assertEqual("&lt;test string&gt;", cgi.escape("<test string>"))
+ self.assertEqual("&quot;test string&quot;", cgi.escape('"test string"', True))
+
def test_strict(self):
for orig, expect in parse_strict_test_cases:
# Test basic parsing