mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Whitespace normalization.
This commit is contained in:
parent
c86c1b88f9
commit
863ac44b74
23 changed files with 84 additions and 88 deletions
|
@ -30,14 +30,14 @@ tests = unittest.TestSuite()
|
|||
|
||||
def RobotTest(index, robots_txt, good_urls, bad_urls,
|
||||
agent="test_robotparser"):
|
||||
|
||||
lines = StringIO.StringIO(robots_txt).readlines()
|
||||
parser = robotparser.RobotFileParser()
|
||||
parser.parse(lines)
|
||||
for url in good_urls:
|
||||
tests.addTest(RobotTestCase(index, parser, url, 1, agent))
|
||||
for url in bad_urls:
|
||||
tests.addTest(RobotTestCase(index, parser, url, 0, agent))
|
||||
|
||||
lines = StringIO.StringIO(robots_txt).readlines()
|
||||
parser = robotparser.RobotFileParser()
|
||||
parser.parse(lines)
|
||||
for url in good_urls:
|
||||
tests.addTest(RobotTestCase(index, parser, url, 1, agent))
|
||||
for url in bad_urls:
|
||||
tests.addTest(RobotTestCase(index, parser, url, 0, agent))
|
||||
|
||||
# Examples from http://www.robotstxt.org/wc/norobots.html (fetched 2002)
|
||||
|
||||
|
@ -116,7 +116,7 @@ Disallow: /%7ejoe/index.html
|
|||
good = ['/tmp',] # XFAIL: '/a%2fb.html'
|
||||
bad = ['/tmp/','/tmp/a.html',
|
||||
'/a%3cd.html','/a%3Cd.html',"/a/b.html",
|
||||
'/%7Ejoe/index.html']
|
||||
'/%7Ejoe/index.html']
|
||||
|
||||
RobotTest(6, doc, good, bad)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue