Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.223.170.69
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_robotparser.pyc
�
?��cc@s"ddlZddlZddlZddlmZddlmZmZddlZyddl	Z	Wne
k
rdZ	nXdd#d��YZdeej
fd��YZdeej
fd	��YZd
eej
fd��YZdefd
��YZdeej
fd��YZdeej
fd��YZdeej
fd��YZdeej
fd��YZdeej
fd��YZdeej
fd��YZdefd��YZeje	d�dej
fd��Y�Zdej
fd ��YZd!�Zed"kre�ndS($i����N(tsupport(tBaseHTTPRequestHandlert
HTTPServert
BaseRobotTestcBsDeZdZdZgZgZd�Zd�Zd�Zd�Z	RS(tttest_robotparsercCs;tj|j�j�}tj�|_|jj|�dS(N(tStringIOt
robots_txtt	readlinestrobotparsertRobotFileParsertparsertparse(tselftlines((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pytsetUpscCs2t|t�r%|\}}||fS|j|fS(N(t
isinstancettupletagent(R
turlR((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pytget_agent_and_urls
cCsIxB|jD]7}|j|�\}}|j|jj||��q
WdS(N(tgoodRt
assertTrueRt	can_fetch(R
RR((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyttest_good_urlsscCsIxB|jD]7}|j|�\}}|j|jj||��q
WdS(N(tbadRtassertFalseRR(R
RR((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyt
test_bad_urls#s(
t__name__t
__module__RRRRRRRR(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR
s			tUserAgentWildcardTestcBs)eZdZddgZdddgZRS(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.html(RRRRR(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR)stRejectAllRobotsTestcBs#eZdZgZdddgZRS(s(# go away
User-agent: *
Disallow: /
    s/cyberworld/map/index.htmlRs/tmp/(RRRRR(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR 4stUserAgentOrderingTestcBseZdZdZdgZRS(sMUser-agent: Googlebot
Disallow: /

User-agent: Googlebot-Mobile
Allow: /
    t	Googlebots/something.jpg(RRRRR(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR!>s
tUserAgentGoogleMobileTestcBseZdZRS(sGooglebot-Mobile(RRR(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR#MstGoogleURLOrderingTestcBs&eZdZdZdgZdgZRS(sJUser-agent: Googlebot
Allow: /folder1/myfile.html
Disallow: /folder1/
    t	googlebots/folder1/myfile.htmls/folder1/anotherfile.html(RRRRRR(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR$Qs	tDisallowQueryStringTestcBs eZdZdgZdgZRS(s2User-agent: *
Disallow: /some/path?name=value
    s
/some/paths/some/path?name=value(RRRRR(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR&^s	tUseFirstUserAgentWildcardTestcBs eZdZdgZdgZRS(sNUser-agent: *
Disallow: /some/path

User-agent: *
Disallow: /another/path
    s
/another/paths
/some/path(RRRRR(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR'hs	tEmptyQueryStringTestcBs eZdZdgZdgZRS(s>User-agent: *
Allow: /some/path?
Disallow: /another/path?
    s/some/path?s/another/path?(RRRRR(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR(us	tDefaultEntryTestcBs#eZdZddgZdgZRS(sOUser-agent: *
Crawl-delay: 1
Request-rate: 3/15
Disallow: /cyberworld/map/
    Rs
/test.htmls/cyberworld/map/index.html(RRRRR(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR)�stStringFormattingTestcBseZdZdZd�ZRS(s�User-agent: *
Crawl-delay: 1
Request-rate: 3/15
Disallow: /cyberworld/map/ # This is an infinite virtual URL space

# Cybermapper knows where to go.
User-agent: cybermapper
Disallow: /some/path
    sXUser-agent: cybermapper
Disallow: /some/path

User-agent: *
Disallow: /cyberworld/map/

cCs |jt|j�|j�dS(N(tassertEqualtstrRtexpected_output(R
((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyttest_string_formatting�s(RRRR-R.(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR*�s
	tRobotHandlercBseZd�Zd�ZRS(cCs|jdd�dS(Ni�sForbidden access(t
send_error(R
((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pytdo_GET�scGsdS(N((R
tformattargs((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pytlog_message�s(RRR1R4(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR/�s	s threading required for this testtPasswordProtectedSiteTestCasecBs,eZd�Zd�Zejd��ZRS(c	Csfttjdft�|_tjddd|jjdidd6�|_t	|j_
|jj�dS(NitnamesHTTPServer servingttargettkwargsg{�G�z�?t
poll_interval(RRtHOSTR/tservert	threadingtThreadt
serve_forevertttTruetdaemontstart(R
((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR�s	cCs+|jj�|jj�|jj�dS(N(R;tshutdownR?tjointserver_close(R
((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyttearDown�s

cCsu|jj}dtjdt|d�}|d}tj�}|j|�|j�|j	|j
d|��dS(Nshttp://t:is/robots.txtt*(R;tserver_addressRR:R,R	R
tset_urltreadRR(R
taddrRt
robots_urlR((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyttestPasswordProtectedSite�s


(RRRRFRtreap_threadsRN(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR5�s	
	tNetworkTestCasecBsPeZdZdje�Zed��Zd�Zd�Zd�Z	d�Z
RS(shttp://www.pythontest.net/s{}elsewhere/robots.txtcCsLtjd�tj|j��'tj|j�|_|jj�WdQXdS(Ntnetwork(	Rtrequiresttransient_internettbase_urlR	R
RRRK(tcls((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyt
setUpClass�s
cCs2dj|j|tjj|�ds+dnd�S(Ns{}{}{}iRR(R2RTtostpathtsplitext(R
RX((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyR�scCsC|j|jj�|j|jj�|j|jj�d�dS(Ni(RRtdisallow_allt	allow_allt
assertGreatertmtime(R
((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyt
test_basic�scCs�|j|jjd|jd���|j|jjd|j��|j|jjd|jd���|j|jjd|jd���|j|jjd|jd���|j|jjd|j��dS(NRHt	elsewheretNutchtbriantwebstats(RRRRRRT(R
((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyttest_can_fetch�s%%%%cCs\tj|jd��}|j�|j|j�|j|j�|j|j	�d�dS(Nsi-robot.txti(
R	R
RRKRR[RRZR+R](R
R((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyt
test_read_404�s

(RRRTR2RtclassmethodRVRR^RcRd(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyRP�s			c
Cs2tjtttttttt	t
ttt
�dS(N(Rtrun_unittestRR R!R#R$R&R'R(R)R*R5RP(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyt	test_main�st__main__((RWR	tunittestttestRtBaseHTTPServerRRRR<tImportErrortNoneRtTestCaseRR R!R#R$R&R'R(R)R*R/t
skipUnlessR5RPRgR(((s</usr/local/python-2.7/lib/python2.7/test/test_robotparser.pyt<module>s6





	&	
© 2025 GrazzMean