summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-03-13 08:50:27 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-03-13 08:50:27 (GMT)
commit47b5ddb9cf0f3e278b54309756d08e79ef76b3a8 (patch)
treeae1bef20b1c818a9723729e4285b18f93655a381
parent1732ab4f152f8da04ab937facef8d57004d67939 (diff)
downloadcpython-47b5ddb9cf0f3e278b54309756d08e79ef76b3a8.zip
cpython-47b5ddb9cf0f3e278b54309756d08e79ef76b3a8.tar.gz
cpython-47b5ddb9cf0f3e278b54309756d08e79ef76b3a8.tar.bz2
3.2 - Fix closes Issue14281 - Test for cgi.escape by Brian Landers
-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 9951e93..3031fb3 100644
--- a/Lib/test/test_cgi.py
+++ b/Lib/test/test_cgi.py
@@ -118,6 +118,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