summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_robotparser.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2013-05-29 12:58:47 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2013-05-29 12:58:47 (GMT)
commit2c4810efa2421c1a3e0042888b71193a917b39c5 (patch)
tree462411035677ad245fc32db3b0fd2eabab22b2c0 /Lib/test/test_robotparser.py
parent1ab29e78f9e61c86879fa8884a543022ea43112d (diff)
downloadcpython-2c4810efa2421c1a3e0042888b71193a917b39c5.zip
cpython-2c4810efa2421c1a3e0042888b71193a917b39c5.tar.gz
cpython-2c4810efa2421c1a3e0042888b71193a917b39c5.tar.bz2
#17403: urllib.parse.robotparser normalizes the urls before adding to ruleline.
This helps in handling certain types invalid urls in a conservative manner.
Diffstat (limited to 'Lib/test/test_robotparser.py')
-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 b3d4a46..651301b 100644
--- a/Lib/test/test_robotparser.py
+++ b/Lib/test/test_robotparser.py
@@ -228,6 +228,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):