;
Ìâ"Ic               @   sü  d  d l  Z  d  d l Z d  d l Z d  d l m Z Gd „  d e j ƒ Z e j ƒ  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 d' g Z d( g Z e
 d) e e e d* d+ ƒd, Z g  Z d- g Z e
 d. e e e d* d+ ƒg  Z d- g Z e
 d/ e e e d* d0 ƒd1 Z g  Z d- g Z e
 d2 e e e d* d+ ƒd- g Z g  Z e
 d3 e e e d* d0 ƒd& Z d' g Z d( g Z e
 d4 e e e d* d5 ƒGd6 „  d7 e j ƒ Z d8 „  Z e d9 k o d e _ e ƒ  n d S(;   i    N(   u   supportc             B   s)   |  Ee  Z d  „  Z d „  Z d „  Z d S(   c             C   si   t  j j |  ƒ | o d | | f |  _ n d | | f |  _ | |  _ | |  _ | |  _ | |  _ d  S(   Nu   RobotTest(%d, good, %s)u   RobotTest(%d, bad, %s)(   u   unittestu   TestCaseu   __init__u   stru   parseru   urlu   goodu   agent(   u   selfu   indexu   parseru   urlu   goodu   agent(    (    u2   /mit/python/lib/python3.0/test/test_robotparser.pyu   __init__   s    			c             C   s‚   t  |  j t ƒ o |  j \ } } n |  j } |  j } |  j o  |  j |  j j | | ƒ ƒ n |  j |  j j | | ƒ ƒ d  S(   N(	   u
   isinstanceu   urlu   tupleu   agentu   goodu
   failUnlessu   parseru	   can_fetchu   failIf(   u   selfu   agentu   url(    (    u2   /mit/python/lib/python3.0/test/test_robotparser.pyu   runTest   s    		
 c             C   s   |  j  S(   N(   u   str(   u   self(    (    u2   /mit/python/lib/python3.0/test/test_robotparser.pyu   __str__   s    N(   u   __name__u
   __module__u   __init__u   runTestu   __str__(   u
   __locals__(    (    u2   /mit/python/lib/python3.0/test/test_robotparser.pyu   RobotTestCase   s   
		u   RobotTestCaseu   test_robotparserc          
   C   s•   t  j | ƒ j ƒ  } t j j ƒ  } | j | ƒ x- | D]% } t j t	 |  | | d | ƒ ƒ q8 Wx- | D]% } t j t	 |  | | d | ƒ ƒ qh Wd  S(   Ni   i    (
   u   iou   StringIOu	   readlinesu   urllibu   robotparseru   RobotFileParseru   parseu   testsu   addTestu   RobotTestCase(   u   indexu
   robots_txtu	   good_urlsu   bad_urlsu   agentu   linesu   parseru   url(    (    u2   /mit/python/lib/python3.0/test/test_robotparser.pyu	   RobotTest"   s     # u’   
User-agent: *
Disallow: /cyberworld/map/ # This is an infinite virtual URL space
Disallow: /tmp/ # these will soon disappear
Disallow: /foo.html
u   /u
   /test.htmlu   /cyberworld/map/index.htmlu   /tmp/xxxu	   /foo.htmli   uÁ   
# 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:

u   cybermapperi   u%   
# go away
User-agent: *
Disallow: /
u   /tmp/i   um   
User-agent: figtree
Disallow: /tmp
Disallow: /a%3cd.html
Disallow: /a%2fb.html
Disallow: /%7ejoe/index.html
u   /tmpu	   /tmp.htmlu   /tmp/a.htmlu   /a%3cd.htmlu   /a%3Cd.htmlu   /a%2fb.htmlu   /~joe/index.htmli   u   figtreei   u   FigTree Robot libwww-perl/5.04uf   
User-agent: *
Disallow: /tmp/
Disallow: /a%3Cd.html
Disallow: /a/b.html
Disallow: /%7ejoe/index.html
u	   /a/b.htmlu   /%7Ejoe/index.htmli   u   
User-Agent: *
Disallow: /.
i   uG   
User-agent: Googlebot
Allow: /folder1/myfile.html
Disallow: /folder1/
u   /folder1/myfile.htmlu   /folder1/anotherfile.htmli   u   agentu	   GooglebotuJ   
User-agent: Googlebot
Disallow: /

User-agent: Googlebot-Mobile
Allow: /
u   /something.jpgi	   i
   u   Googlebot-MobileuJ   
User-agent: Googlebot-Mobile
Allow: /

User-agent: Googlebot
Disallow: /
i   i   i   u	   googlebotc             B   s    |  Ee  Z d  „  Z d „  Z d S(   c             C   se   t  j d ƒ p d  Sd } t j j ƒ  } | j | ƒ | j ƒ  |  j | j d | d ƒ d ƒ d  S(   Nu   networku   http://mueblesmoraleda.comu   *u   /robots.txtF(
   u   supportu   is_resource_enabledu   urllibu   robotparseru   RobotFileParseru   set_urlu   readu   assertEqualu	   can_fetchu   False(   u   selfu   urlu   parser(    (    u2   /mit/python/lib/python3.0/test/test_robotparser.pyu   testPasswordProtectedSiteÒ   s    
c             C   sN   t  j d ƒ p d  St j j d ƒ } | j ƒ  |  j | j d d ƒ ƒ d  S(   Nu   networku    http://www.python.org/robots.txtu   *(   u   supportu   is_resource_enabledu   urllibu   robotparseru   RobotFileParseru   readu
   assertTrueu	   can_fetch(   u   selfu   parser(    (    u2   /mit/python/lib/python3.0/test/test_robotparser.pyu   testPythonOrgÜ   s    		
N(   u   __name__u
   __module__u   testPasswordProtectedSiteu   testPythonOrg(   u
   __locals__(    (    u2   /mit/python/lib/python3.0/test/test_robotparser.pyu   NetworkTestCaseÐ   s   
	
u   NetworkTestCasec               C   s   t  j t ƒ t  j t ƒ d  S(   N(   u   supportu   run_unittestu   NetworkTestCaseu   tests(    (    (    u2   /mit/python/lib/python3.0/test/test_robotparser.pyu	   test_mainå   s    u   __main__(   u   cybermapperu   /cyberworld/map/index.html(   u   iou   unittestu   urllib.robotparseru   urllibu   testu   supportu   TestCaseu   RobotTestCaseu	   TestSuiteu   testsu	   RobotTestu   docu   goodu   badu   NetworkTestCaseu	   test_mainu   __name__u   verbose(    (    (    u2   /mit/python/lib/python3.0/test/test_robotparser.pyu   <module>   s|   												
										