summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2013-05-29 12:57:21 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2013-05-29 12:57:21 (GMT)
commit6b3026ce7299056a3f10b25426cda34d771857ac (patch)
tree4aab00c18f16f3a9e9f9dc02e616417836caaac5 /Lib/test
parent7b503965a0c19c1a19d244e15b74cb0964f08c3c (diff)
parentc70a6ae49bd162af06130e48a45579d445e058a8 (diff)
downloadcpython-6b3026ce7299056a3f10b25426cda34d771857ac.zip
cpython-6b3026ce7299056a3f10b25426cda34d771857ac.tar.gz
cpython-6b3026ce7299056a3f10b25426cda34d771857ac.tar.bz2
merge from 3.3
#17403: urllib.parse.robotparser normalizes the urls before adding to ruleline. This helps in handling certain types invalid urls in a conservative manner. Patch contributed by Mher Movsisyan.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_robotparser.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py
index 8c09e74..d1dfd9e 100644
--- a/Lib/test/test_robotparser.py
+++ b/Lib/test/test_robotparser.py
@@ -234,6 +234,18 @@ bad = ['/some/path']
RobotTest(15, doc, good, bad)
+# 16. Empty query (issue #17403). Normalizing the url first.
+doc = """
+User-agent: *
+Allow: /some/path?
+Disallow: /another/path?
+"""
+
+good = ['/some/path?']
+bad = ['/another/path?']
+
+RobotTest(16, doc, good, bad)
+
class NetworkTestCase(unittest.TestCase):