????

Your IP : 216.73.216.152


Current Path : /proc/self/root/proc/self/root/lib/python2.7/site-packages/wheel/test/
Upload File :
Current File : //proc/self/root/proc/self/root/lib/python2.7/site-packages/wheel/test/test_basic.pyc

�
��]c@sdZddlZddlZddlZddlZddlmZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZdZd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS(s
Basic wheel tests.
i����N(tresource_filename(t	egg2wheel(t	WheelFile(tZipFile(trmtreescomplex-distssimple.distsheaders.distcCsltjdd�}xStD]K}xBdD]:}y ttjj|||��Wq&tk
r_q&Xq&WqWdS(s$Delete eggs/wheels created by tests.s
wheel.testttbuildtdistN(sbuildsdist(t
pkg_resourcesRttest_distributionsRtostpathtjointOSError(tbaseRtsubdir((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pytteardown_modules

 
cCst�t�dS(N(tbuild_wheelt	build_egg(((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pytsetup_module scBs�x�eD]~}ejjej�}ejd|�}ej|�z3ddge_	e
ed�j�dd�dUWdej|�XqWdS(s%Build wheels from test distributions.s
wheel.testRtbdist_wheelssetup.pytexecN(
R	R
RtabspathtcurdirRRtchdirtsystargvtcompiletopentread(Rtpwdtdistdir((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyR$s

$cBs�x�eD]~}ejjej�}ejd|�}ej|�z3ddge_	e
ed�j�dd�dUWdej|�XqWdS(s#Build eggs from test distributions.s
wheel.testRt	bdist_eggssetup.pyRN(
R	R
RRRRRRRRRRR(RRR((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyR0s

$cCstjjdjst�dS(s$Make sure pkg_resources can find us.twheelN(Rtworking_settby_keytversiontAssertionError(((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyt
test_findable<scCscttjdd��}xD|D]<}|j�}|s=qntjj|�st|��qWdS(sMake sure egg_info_re matches.R!seggnames.txtN(RRRtstripRtegg_info_retmatchR%(t	egg_namestline((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyttest_egg_re@s
cCs}td�}t|j�ddgks-t�|jdksBt�td�}|jj�}|dd	ksyt|��d
S(
s#Test compatibilty tags are working.s(package-1.0.0-cp32.cp33-noabi-noarch.whltcp32tnoabitnoarchtcp33is'package-1.0.0-1st-cp33-noabi-noarch.whlRt1stN(R-R.snoarch(R0R.snoarch(Rtlisttcompatibility_tagsR%taritytparsed_filenamet	groupdict(twftwf2twf2_info((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyttest_compatibility_tagsIscCs�tjdd�}xptD]h}tjj||d�}gtj|�D]}|jd�rG|^qG}tj	j
||dt�qWdS(Ns
wheel.testRRs.eggtverbose(RRR	R
RRtlistdirtendswithR!ttooltconverttFalse(RRRteteggs((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyttest_convert_eggTs

1cCs|xutD]m}tjdtjj|d��}xCd�tj|�D�D](}tjj	tjj||�|�qHWqWdS(sj
    Make sure 'wheel unpack' works.
    This also verifies the integrity of our testing wheel files.
    s
wheel.testRcss$|]}|jd�r|VqdS(s.whlN(R=(t.0tw((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pys	<genexpr>csN(
R	RRR
RRR<R!R>tunpack(RRt	wheelfile((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyttest_unpack[s

	 cCs�d}tjd|�}x�tj|�D]y\}}}xg|D]_}|jd�r>ttjj||��}x,|j�D]}d|j	ks{t
�q{Wq>q>Wq(WdS(s0Make sure entry point scripts are not generated.scomplex-dists
wheel.tests.whls.data/scripts/N(RRR
twalkR=RRRtinfolisttfilenameR%(Rtbasedirtdirnametsubdirst	filenamesRKtwhltentry((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyttest_no_scriptsfs
c
Cs7ddl}d�}|tdd��}d}x�dD]�}tjd|�}x�tj|�D]�\}}}x�|D]�}	|	jd	�ruttjj||	��}
xg|
j	�D]V}|j
jd
�r�tj|
j
|�jd��}|j||�|d7}q�q�WququWq_Wq7W|dks3td
��dS(s>Make sure pydist.json exists and validates against our schema.i����NcSs%tjt|d�j�jd��S(Ntrbsutf-8(tjsontloadsRRtdecode(RK((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyt	open_jsonwss
wheel.testspydist-schema.jsonissimple.distscomplex-dists.whls/metadata.jsonsutf-8isNo metadata.json found(ssimple.distscomplex-dist(t
jsonschemaRRR
RIR=RRRRJRKRTRURRVtvalidateR%(
RXRWt
pymeta_schematvalidRRLRMRNRORKRPRQtpymeta((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyttest_pydistqs"		

! cCsqxjtd�D]\}d|}tjj|�}|jd�sEt�tjj|�}||ks
t�q
WdS(sTest functions in util.py.i
t*t=N(trangeR!tutilturlsafe_b64encodeR=R%turlsafe_b64decode(titbeforetencodedtafter((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyt	test_util�s
c
s�d�}ddddddg}g|D]}td
|�^q(}ddg}ddddg}ddddg}xo|||fD]^��fd�}x|D]}||_q�Wt|�}	t|	j�d�dks�t�q�Wd
S(s!Test the wheel ranking algorithm.cSs,|djj�}|d|d|dfS(Ni����tpyvertabitplat(R5R6(trestinfo((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pytget_tags�stpy27R.R/tpy26tcp27t
linux_i686tcp26tlinux_x86_64stestpkg-1.0-%s-%s-%s.whlcs
t��S(N(R2((tsupp(s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyt<lambda>�siN(Rosnoabisnoarch(Rpsnoabisnoarch(Rqsnoabis
linux_i686(Rssnoabis
linux_i686(Rqsnoabislinux_x86_64(Rssnoabislinux_x86_64(Rqsnoabis
linux_i686(Rosnoabisnoarch(Rqsnoabis
linux_i686(Rosnoabisnoarch(Rssnoabis
linux_i686(Rpsnoabisnoarch(Rssnoabis
linux_i686(Rpsnoabisnoarch(Rqsnoabis
linux_i686(Rosnoabisnoarch(RtcontexttmaxR2ttagsR%(
Rnt	cand_tagstttcand_wheelst	supportedt
supported2t
supported3RwR!tbest((Rus4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyttest_pick_best�s&		 

(scomplex-distssimple.distsheaders.dist(t__doc__R
RRTRRt
wheel.utilR!t
wheel.toolRt
wheel.installRtzipfileRtshutilRR	RRRRR&R,R:RCRHRRR]RhR�(((s4/tmp/pip-build-tmgNo5/wheel/wheel/test/test_basic.pyt<module>s2