mς
­fIc           @   sΥ  d  k  Z  d  k Z d  k Z d k l Z d e  i f d     YZ e  i   Z d d  Z	 d Z
 d d g Z d	 d
 d g Z e	 d e
 e e  d Z
 d d d' g Z d	 g Z e	 d e
 e e  d Z
 g  Z d	 d d g Z e	 d e
 e e  d Z
 g  Z d d d d d d d g Z e	 d e
 e e d  e	 d e
 e e d  d Z
 d g Z d d d d d  d! g Z e	 d" e
 e e  d# Z
 d g Z g  Z e	 d$ e
 e e  d%   Z e d& j o d e _ e i e  n d  S((   N(   s   test_supportt   RobotTestCasec           B   s#   t  Z d   Z d   Z d   Z RS(   Nc         C   si   t  i i |   | o d | | f |  _ n d | | f |  _ | |  _ | |  _ | |  _ | |  _	 d  S(   Ns   RobotTest(%d, good, %s)s   RobotTest(%d, bad, %s)(
   t   unittestt   TestCaset   __init__t   selft   goodt   indext   urlt   strt   parsert   agent(   R   R   R	   R   R   R
   (    (    t2   /mit/python/lib/python2.4/test/test_robotparser.pyR      s    			c         C   s   t  |  i t  o |  i \ } } n |  i } |  i } |  i o  |  i |  i i | |   n |  i	 |  i i | |   d  S(   N(
   t
   isinstanceR   R   t   tupleR
   R   t
   failUnlessR	   t	   can_fetcht   failIf(   R   R   R
   (    (    R   t   runTest   s    		
 c         C   s   |  i S(   N(   R   R   (   R   (    (    R   t   __str__   s    (   t   __name__t
   __module__R   R   R   (    (    (    R   R       s   		t   test_robotparserc         C   s   t  i  |  i   } t i   } | i |  x- | D]% } t
 i t |  | | d |   q5 Wx- | D]% } t
 i t |  | | d |   qe Wd  S(   Ni   i    (   t   StringIOt
   robots_txtt	   readlinest   linest   robotparsert   RobotFileParserR	   t   parset	   good_urlsR   t   testst   addTestR    R   R
   t   bad_urls(   R   R   R   R    R
   R	   R   R   (    (    R   t	   RobotTest    s     # s   
User-agent: *
Disallow: /cyberworld/map/ # This is an infinite virtual URL space
Disallow: /tmp/ # these will soon disappear
Disallow: /foo.html
t   /s
   /test.htmls   /cyberworld/map/index.htmls   /tmp/xxxs	   /foo.htmli   sΑ   
# robots.txt for http://www.example.com/

User-agent: *
Disallow: /cyberworld/map/ # This is an infinite virtual URL space

# Cybermapper knows where to go.
User-agent: cybermapper
Disallow:

t   cybermapperi   s%   
# go away
User-agent: *
Disallow: /
s   /tmp/i   sm   
User-agent: figtree
Disallow: /tmp
Disallow: /a%3cd.html
Disallow: /a%2fb.html
Disallow: /%7ejoe/index.html
s   /tmps	   /tmp.htmls   /tmp/a.htmls   /a%3cd.htmls   /a%3Cd.htmls   /a%2fb.htmls   /~joe/index.htmli   t   figtreei   s   FigTree Robot libwww-perl/5.04sf   
User-agent: *
Disallow: /tmp/
Disallow: /a%3Cd.html
Disallow: /a/b.html
Disallow: /%7ejoe/index.html
s	   /a/b.htmls   /%7Ejoe/index.htmli   s   
User-Agent: *
Disallow: /.
i   c           C   s   t  i t  d  S(   N(   t   test_supportt	   run_suiteR   (    (    (    R   t	   test_main   s    t   __main__(   R#   s   /cyberworld/map/index.html(   R   R   R   t   testR%   R   R    t	   TestSuiteR   R!   t   docR   t   badR'   R   t   VerboseR&   (   R%   R   R   R   R+   R   R    R!   R,   R'   R   (    (    R   t   ?   sB   					