Current File : //opt/imh-python/lib/python2.7/test/test_robotparser.pyo
�
��Wc@s�ddlZddlZddlZddlmZddlmZmZeZ	yddlm
Z
Wnek
r}eZ	nXdej
fd��YZej�Zdd�Zd	Zd
dgZdd
dgZedeee�dZd
ddGgZdgZedeee�dZgZdd
dgZedeee�dZgZdddddddgZedeeed�ed eeed!�d"ZdgZddddd#d$gZed%eee�d&ZdgZgZed'eee�d(Zd)gZd*gZed+eeed,d-�d.ZgZd/gZed0eeed,d-�gZd/gZed1eeed,d2�d3ZgZd/gZed4eeed,d-�d/gZgZed5eeed,d2�d(Zd)gZd*gZed6eeed,d7�d8Zd9gZd:gZed;eee�d<Zd=gZd9gZed>eee�d?Zd@gZdAgZedBeee�dCej
fdD��YZdE�ZedFkr�de_e�ndS(Hi����N(ttest_support(turlopent	HTTPError(tHTTPSHandlert
RobotTestCasecBs#eZd�Zd�Zd�ZRS(cCsgtjj|�|r,d||f|_nd||f|_||_||_||_||_dS(NsRobotTest(%d, good, %s)sRobotTest(%d, bad, %s)(tunittesttTestCaset__init__tstrtparserturltgoodtagent(tselftindexR	R
RR((sn/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_robotparser.pyRs			cCs~t|jt�r$|j\}}n|j}|j}|jr^|j|jj||��n|j|jj||��dS(N(	t
isinstanceR
ttupleRRt
assertTrueR	t	can_fetchtassertFalse(R
RR
((sn/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_robotparser.pytrunTests			cCs|jS(N(R(R
((sn/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_robotparser.pyt__str__"s(t__name__t
__module__RRR(((sn/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_robotparser.pyRs		ttest_robotparsercCs�tj|�j�}tj�}|j|�x-|D]%}tjt|||d|��q5Wx-|D]%}tjt|||d|��qeWdS(Nii(tStringIOt	readlinestrobotparsertRobotFileParsertparsetteststaddTestR(Rt
robots_txtt	good_urlstbad_urlsRtlinesR	R
((sn/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_robotparser.pyt	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.htmlis�
# 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:

tcybermapperis%
# go away
User-agent: *
Disallow: /
s/tmp/ism
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.htmlitfigtreeisFigTree 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.htmlis
User-Agent: *
Disallow: /.
isG
User-agent: Googlebot
Allow: /folder1/myfile.html
Disallow: /folder1/
s/folder1/myfile.htmls/folder1/anotherfile.htmliRt	GooglebotsJ
User-agent: Googlebot
Disallow: /

User-agent: Googlebot-Mobile
Allow: /
s/something.jpgi	i
sGooglebot-MobilesJ
User-agent: Googlebot-Mobile
Allow: /

User-agent: Googlebot
Disallow: /
iii
t	googlebots/
User-agent: *
Disallow: /some/path?name=value
s
/some/paths/some/path?name=valueisK
User-agent: *
Disallow: /some/path

User-agent: *
Disallow: /another/path
s
/another/pathis;
User-agent: *
Allow: /some/path?
Disallow: /another/path?
s/some/path?s/another/path?itNetworkTestCasecBs5eZd�Zejed�ejd���ZRS(c	Cstjd�tjd���d}|d}yt|�WnEtk
r�}|jddhkr�|jd||jf�q�nX|jd|�tj�}|j	|�y|j
�Wn"tk
r�|jd	|�nX|j|j
d
|�t�WdQXdS(Ntnetworksmueblesmoraleda.comshttp://mueblesmoraleda.coms/robots.txti�i�s0%r should return a 401 or 403 HTTP error, not %rs5%r should return a 401 or 403 HTTP error, not succeeds%s is unavailablet*(Rtrequiresttransient_internetRRtcodetskipTestRRtset_urltreadtIOErrortassertEqualRtFalse(R
R
t
robots_urlteR	((sn/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_robotparser.pyttestPasswordProtectedSite�s*



s$need SSL support to download licensecCsYtjd�tjd��7tjd�}|j�|j|jdd��WdQXdS(NR+swww.python.orgs!https://www.python.org/robots.txtR,(RR-R.RRR2RR(R
R	((sn/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_robotparser.pyt
testPythonOrgs
	
(	RRR8Rt
skipUnlesst
HAVE_HTTPSRtsystem_must_validate_certR9(((sn/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_robotparser.pyR*�s	cCstjt�tjt�dS(N(Rtrun_unittestRR*(((sn/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_robotparser.pyt	test_main"s
t__main__(R&s/cyberworld/map/index.html(RRRttestRturllib2RRtTrueR;RtImportErrorR5RRt	TestSuiteRR$tdocRtbadR*R>Rtverbose(((sn/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_robotparser.pyt<module>s�$


												
															(