summaryrefslogtreecommitdiff
path: root/Lib/test/test_robotparser.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2007-08-28 23:22:52 +0000
committerSkip Montanaro <skip@pobox.com>2007-08-28 23:22:52 +0000
commit1a413136843f17ede1d3f87f9bab23a07748312c (patch)
tree0385cbd7f00a571b53e1cfbef1ac2763cd33ee6f /Lib/test/test_robotparser.py
parentbf138333ce006c0b3bc49ddd4379312171ef2aae (diff)
downloadcpython-git-1a413136843f17ede1d3f87f9bab23a07748312c.tar.gz
fixes 813986
Diffstat (limited to 'Lib/test/test_robotparser.py')
-rw-r--r--Lib/test/test_robotparser.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py
index 666d00ac50..9163ef859d 100644
--- a/Lib/test/test_robotparser.py
+++ b/Lib/test/test_robotparser.py
@@ -134,8 +134,19 @@ bad = [] # Bug report says "/" should be denied, but that is not in the RFC
RobotTest(7, doc, good, bad)
+class TestCase(unittest.TestCase):
+ def runTest(self):
+ test_support.requires('network')
+ # whole site is password-protected.
+ url = 'http://mueblesmoraleda.com'
+ parser = robotparser.RobotFileParser()
+ parser.set_url(url)
+ parser.read()
+ self.assertEqual(parser.can_fetch("*", url+"/robots.txt"), False)
+
def test_main():
test_support.run_unittest(tests)
+ TestCase().run()
if __name__=='__main__':
test_support.Verbose = 1