b-Qc@s`ddklZlZddkTddklZlZddklZl Z ddk Z ddkZddk Z ddk Z ddk Z yeWn#ej oddklZnXedZdefd YZd efd YZd efd YZdefdYZdefdYZdefdYZdefdYZdS(i(tTestCaset makeSuite(t*(tget_script_headertis_sh(tStringIOt iteritemsN(t ImmutableSetcCsayt|}Wn"tj oti|}nX| pt|tjo|S|t dS(s copied from Python2.7s [truncated]...(treprt Exceptiontobjectt__repr__tlent _MAX_LENGTH(tobjtshorttresult((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt safe_repr stMetadatacBs2eZdZdZdZdZdZRS(sAMock object to return metadata as if from an on-disk distributioncGst||_dS(N(tdicttmetadata(tselftpairs((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt__init__scCs ||ijS(N(R(Rtname((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt has_metadatascCs |i|S(N(R(RR((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt get_metadatascCst|i|S(N(t yield_linesR(RR((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pytget_metadata_lines"s(t__name__t __module__t__doc__RRRR(((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyRs    t DistroTestscBseeZdZdZdZdZdZdZd dZdZ dZ d Z RS( c Cstgdddd}|it|g|i|dg|itid|itid|itid|i|d|it|dg|ig}|dD]}||iq~dd d g|i |dd |ig}|dD]}||iq~dd g|itid |ig}|dD]}||iqa~d dd gt g}tid}tid}t d\} |i|i | |id |i||i|i | |idt g}|i||i||i t|i | |t g}|i||i||i||i|i | |iddS(NtplatformtpythontFooPkgsFooPkg-1.3_1.eggsFooPkg-1.4-py2.4-win32.eggsFooPkg-1.2-py2.4.eggtfoopkgs1.4s1.3-1s1.2isFooPkg-1.9.eggs1.9s FooPkg>=1.3(t EnvironmenttNonet assertEqualtlisttaddt Distributiont from_filenamet assertTruetversiontremovet WorkingSettparse_requirementst best_matcht assertRaisestVersionConflict( Rtadt_[1]tdistt_[2]t_[3]twstfoo12tfoo14treq((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestCollection's@525    cCs||i|id|i|id|i|id|i|id|i|id|i|itddS(NR#R$s1.3-1s2.4twin32(R't project_nametkeyR-t py_versionR!tparsed_versiont parse_version(Rtd((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt checkFooPkgVs c Csntddddddddd }|i|td}|i|itid |i|iddS( Ns /some/pathR?R#R-s1.3-1RAs2.4R!R>i(R*RER'RAtsysR-R!R&(RRD((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestDistroBasics^s  cCs<tid}|i|tid}|i|dS(NsFooPkg-1.3_1-py2.4-win32.eggs!FooPkg-1.3_1-py2.4-win32.egg-info(R*R+RE(RRD((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestDistroParseis c Cs;tddddddddtd }|i|dS( Ns /some/pathR?R#RAs2.4R!R>RsPKG-INFOs%Metadata-Version: 1.0 Version: 1.3-1 (sPKG-INFOs%Metadata-Version: 1.0 Version: 1.3-1 (R*RRE(RRD((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestDistroMetadataos  cCstddtd|fS(Ns/fooRs depends.txt(R*R(Rttxt((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt distRequiresyscCs/|it|i|tt|dS(N(R'R(trequiresR0(RR6RJtextras((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt checkRequires|scCs.x'dD]}|i|i||qWdS(Ns Twisted>=1.5sTwisted>=1.5 ZConfig>=2.0(s Twisted>=1.5sTwisted>=1.5 ZConfig>=2.0(RNRK(Rtv((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestDistroDependsSimplescCstg}tg}|it|ig|g|it|itd|ti ddt d }|i ||i ti dx[t dD]M}t|itd|}|i||gtt |i |qW|it|itd|tg}|it|itd |ti d dt d }|i ||it|itd |||g|it|itd |dS(NtFoos/foo_dir/Foo-1.2.eggRs depends.txts[bar] Baz>=2.0s Foo-0.9.eggisFoo==0.9sFoo[bar]s/foo_dir/Baz-2.1.eggsFoo==1.2 Foo!=1.2(s depends.txts[bar] Baz>=2.0(s depends.txtsFoo(R%R/R'R(tresolveR2tDistributionNotFoundR0R*R+RR)trangetmapR3(RR4R9RQtittargetstBaz((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt testResolves6 "    ( cCs|id}|i|d|i|didg|i|didg|i|diddg|i|diddg|it|id gdS( Ns Twisted>=1.5 [docgen] ZConfig>=2.0 docutils>=0.3 [fastcgi] fcgiapp>=0.1s Twisted>=1.5s'Twisted>=1.5 ZConfig>=2.0 docutils>=0.3tdocgensTwisted>=1.5 fcgiapp>=0.1tfastcgis4Twisted>=1.5 ZConfig>=2.0 docutils>=0.3 fcgiapp>=0.1s4Twisted>=1.5 fcgiapp>=0.1 ZConfig>=2.0 docutils>=0.3tfoo(RKRNtsplitR2t UnknownExtraRL(RRD((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestDistroDependsOptionss     (( RRR=RERGRHRIRKRNRPRYR_(((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyR %s /      )tEntryPointTestsc BseZdZdZdZdZdZdZede dddgd e d d d gd d gde ddddgZ dZ dZ dZ RS(cCs|i|id|i|id|i|id|i|id|i|itj|it|ddS(NR\ssetuptools.tests.test_resourcesR`txs9foo = setuptools.tests.test_resources:EntryPointTests [x](sEntryPointTests(Ra( R'Rt module_nametattrsRMR,tloadR`tstr(Rtep((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt assertfieldss cCs"tiddtd|_dS(NsFooPkg-1.2-py2.4.eggRs requires.txts[x](s requires.txts[x](R*R+RR6(R((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pytsetUpscCs2tdddgdg|i}|i|dS(NR\ssetuptools.tests.test_resourcesR`Ra(t EntryPointR6Rg(RRf((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt testBasicss cCsd}ti||i}|i|tid}|i|id|i|id|i|id |i|id tid}|i|id|i|id|i|id |i|id dS(Ns9foo = setuptools.tests.test_resources:EntryPointTests [x]sbar baz= spammity[PING]sbar baztspammitytpings fizzly = wocka:footfizzlytwockaR\((Rl(sfoo(( RitparseR6RgR'RRbRcRM(RtsRf((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt testParses cCs]xVddddddgD]<}yti|Wntj oqXtd|qWdS(NR\sx=1=2sx=a:b:csq=x/nasfez=pish:tush-zsx=f[a]>2sShould've been bad(RiRot ValueErrortAssertionError(RRf((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt testRejectsscCsh|it|t|ixBt|iD]1\}}|it|i|t|q/WdS(N(R'R t submap_expectRRtget(RtmR@Rf((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt checkSubMaps tfeature1t somemodulet somefunctiontfeature2sanother.modulet SomeClasstextra1textra2tfeature3s this.moduleRMt somethings # define features for blah blah feature1 = somemodule:somefunction feature2 = another.module:SomeClass [extra1,extra2] feature3 = this.module [something] cCsX|itid|i|ittidd|ittidddgdS(Ntxyzsx asfoo=barRasfoo=baz(RxRit parse_groupt submap_strR2Rr(R((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt testParseList scCstih|id6}|i|d|it|idgtid|i}|i|d|it|idg|ittiddg|itti|idS(NRs[xyz] s[xyz]( Rit parse_mapRRxR'R(tkeysR2Rr(RRw((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt testParseMaps(RRRgRhRjRqRtRxRRiRuRRR(((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyR`s      tRequirementsTestscBsGeZdZdZdZdZdZdZdZRS(cCstid}|it|d|it|d|i|tdd gd |i|tdd gd|i|tddgd|i|tddgd|i|tddgd|i|tid dS(Ns Twisted>=1.2s!Requirement.parse('Twisted>=1.2')tTwisteds>=s1.2ttwisTeds2.0tZopes3.0sTwisted[extras]>=1.2(s>=s1.2((s>=s1.2((s>=s2.0((s>=s1.2((s>=s3.0((t RequirementRoR'ReRtassertNotEqual(Rtr((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyRjscCsvtdddgd }tdd d gd }|i|||it|t||it|ddS( NRs==s1.2c1s>=s1.2sTwisted==1.2c1,>=1.2(s==s1.2c1(s>=s1.2((s>=s1.2(s==s1.2c1((RR'Re(Rtr1tr2((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt testOrdering)s cCstddgd }tid}tid}tid}|itd|j|itd|j|id|j|id|j|i||j|i||j|i||jdS( NRs>=s1.2sFooPkg-1.3_1.eggsTwisted-1.1.eggsTwisted-1.2.eggs1.1(s>=s1.2((RR*R+R,RC(RRtfoo_distttwist11ttwist12((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestBasicContains0sc Csmtd\}x*dD]"}|i||j||fqWx*dD]"}|i||j||fqCWdS(Ns*Foo>=1.2,<=1.3,==1.9,>2.0,!=2.5,<3.0,==4.5s1.2s1.2.2s1.3s1.9s2.0.1s2.3s2.6s3.0c1s4.5s1.2c1s1.3.1s1.5s1.9.1s2.0s2.5s3.0s4.0( s1.2s1.2.2s1.3s1.9s2.0.1s2.3s2.6s3.0c1s4.5(s1.2c1s1.3.1s1.5s1.9.1s2.0s2.5s3.0s4.0(R0R,(RRRO((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestAdvancedContains=s cCstid}tid}tid}|i|||i|||i|id |i|id |it|t||it|tddtdfftddgfdS( NsTwisted[foo,bar]>=1.2sTwisted[bar,FOO]>=1.2sTwisted[BAR,FOO]>=1.2.0R\tbarttwisteds>=s1.2(sfooR(Rsfoo(RRoR'RMthashRCt frozenset(RRRtr3((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestOptionsAndHashingEs!cCstid}tid}ti}|i|d|j|i|d|j|i|d|j|i|d|j|i|d|j|i|d|j|i|d|jdS(Ns foo==0.3a2s foo!=0.3a4s foo-0.3a4.eggs foo-0.3a1.eggs foo-0.3a2.eggs foo-0.3a3.eggs foo-0.3a5.egg(RRoR*R+R,(RRRRD((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestVersionEqualitySs cCst|itidid|itidid|itidid|itididdS(sQ The setuptools project should implement the setuptools package. t setuptoolsssetuptools == 0.7ssetuptools == 0.7a1ssetuptools >= 0.7N(R'RRoR?(R((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestSetuptoolsProjectNameas( RRRjRRRRRR(((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyRs    t ParseTestscBsPeZdZdZdZdZdZdZdZdZ RS(cCs |ittdgdS(Nt(R'R(R0(R((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestEmptyParse|scCsxxggfddgfgggfdddgfddgddgfgD]+\}}|itti||qLWdS(NRas x ytysx (R'R(t pkg_resourcesR(Rtinptout((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt testYieldings 0 cCs{|ittidddgfdddgfddgfdgfd d gfg|itttid dS( Ns x [Y] z a [b ] # foo c [ d] [q] v RatYtztatbtcRDtqROs[foo(R'R(Rtsplit_sectionsR&R2Rr(R((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt testSplittings  CcCsr|itdd|itdd|itdd|itdd|itdddS( Ns adns-pythons WSGI Utilss WSGI-Utilss WSGI Utilss Money$$$Makers Money-Makerspeak.webspeak-web(R't safe_nameR(R((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyt testSafeNames cCsr|itdd|itdd|itdd|itdd|itdddS( Ns1.2-1s 1.2 alphas 1.2.alphas2.3.4 20050521s2.3.4.20050521s Money$$$Makers Money-Makerspeak.web(R't safe_version(R((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestSafeVersions cCs|ittdtddgdg|ittdtdddgdg|itid td dgd|ittid|ittid|ittid|ittid|ittiddS(NsTwis-Ted>=1.2-1sTwis-Teds>=s1.2-1sTwisted >=1.2, \ # more <2.0Rs1.2t=2.3sx\sx==2 qs X==1 Y==2t#(s>=s1.2-1((s>=s1.2(Rs2.0((s==s1.99a3((R'R(R0RRoR2Rr(R((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestSimpleRequirementss csfd}|dd|dd|dd|dd|d d |d d |d d|d d|dd|dddS(Ncs<t|t|}}i||||||fdS(N(RCR'(ts1ts2tp1tp2(R(sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyRss1.2-rc1s1.2rc1s0.4s0.4.0s0.4.0.0s0.4.0-0s0.4-0t0pl1s0.0pl1t0pre1s0.0c1s 0.0.0preview1t0c1s0-rc1s1.2a1s1.2.a.1s1.2...as1.2a((RR((RsE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyRs         csLfd}|dd|dd|dd|dd|dd |dd|dd |d d|d d |dd|dd|dd|dd|dd|dd|dd|dd|dddi}x@t|D]2\}}x#||d D]}|||q-WqWdS(!Ncs?t|t|}}i||j||||fdS(N(RCR,(RRRR(R(sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyRss2.1s2.1.1t2a1t2b0s2.3a1s2.3s2.1-1s2.1-2s2.1pl4s2.1a0-20040501s1.1s02.1tA56tB27s3.2s3.2.pl0s3.2-1s3.2pl1s3.2pl1-1s0.4s4.0s0.0.4s0.4.0Rs0.4pl1s 2.1.0-rc1s2.1.0s2.1devs2.1a0s 0.80.1-3 0.80.1-2 0.80.1-1 0.79.9999+0.80.0pre4-1 0.79.9999+0.80.0pre2-3 0.79.9999+0.80.0pre2-2 0.77.2-1 0.77.1-1 0.77.0-1 i(R]t enumerate(RRttorturetptv1tv2((RsE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttestVersionOrderings2                    ( RRRRRRRRRR(((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyRzs       tScriptHeaderTestscBs eZdZdZdZRS(s/Users/José/bin/pythoncCstiid ptti o||itddtii ti|itddtii ti|itdd|i d|i ndS( Ntjavas#!/usr/local/bin/pythons#!%s s#!/usr/bin/python -xs #!%s -x s#!/usr/bin/pythont executables#!%s -x ( RFR!t startswithRRR'Rtostpathtnormpatht non_ascii_exe(R((sE/usr/lib/python2.6/vendor-packages/setuptools/tests/test_resources.pyttest_get_script_headers% cCstidjotiiddjodSdddY}|tids  < R^{: