summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_robotparser.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2013-05-29 12:54:31 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2013-05-29 12:54:31 (GMT)
commitc70a6ae49bd162af06130e48a45579d445e058a8 (patch)
treececb299ec31a93cda7d9256a7092cd601be0c0b4 /Lib/test/test_robotparser.py
parenteb4c9c77b8257c05b40467651bdc7764295926e8 (diff)
downloadcpython-c70a6ae49bd162af06130e48a45579d445e058a8.zip
cpython-c70a6ae49bd162af06130e48a45579d445e058a8.tar.gz
cpython-c70a6ae49bd162af06130e48a45579d445e058a8.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 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):