Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/distutils/tests/test_upload.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
dZdZd	efd
��YZde
fd��YZd
�Zedkr�ee��ndS(s#Tests for distutils.command.upload.i�N(trun_unittest(tupload(tDistribution(tPYPIRCtPyPIRCCommandTestCases�[distutils]

index-servers =
    server1
    server2

[server1]
username:me
password:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

[server2]
username:meagain
password: secret
realm:acme
repository:http://another.pypi/
s@[distutils]

index-servers =
    server1

[server1]
username:me
tFakeOpencBseZd�Zd�ZRS(cCs:||_t|t�s$||_n	d|_d|_dS(NtOK(turlt
isinstancetstrtreqtNonetmsg(tselfR((s1/sys/lib/python2.7/distutils/tests/test_upload.pyt__init__,s
		cCsdS(Ni�((R
((s1/sys/lib/python2.7/distutils/tests/test_upload.pytgetcode4s(t__name__t
__module__RR(((s1/sys/lib/python2.7/distutils/tests/test_upload.pyR*s	tuploadTestCasecBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs8tt|�j�tj|_|jt_d|_dS(N(	tsuperRtsetUpt
upload_modturlopentold_opent_urlopenRt	last_open(R
((s1/sys/lib/python2.7/distutils/tests/test_upload.pyR:scCs#|jt_tt|�j�dS(N(RRRRRttearDown(R
((s1/sys/lib/python2.7/distutils/tests/test_upload.pyR@scCst|�|_|jS(N(RR(R
R((s1/sys/lib/python2.7/distutils/tests/test_upload.pyRDscCsr|j|jt�t�}t|�}|j�x9d	d
ddfD]%\}}|jt||�|�qEWdS(
Ntusernametmetpasswordtsecrettrealmtpypit
repositoryshttp://pypi.python.org/pypi(RR(spasswordR(RR (R!shttp://pypi.python.org/pypi(t
write_filetrcRRRtfinalize_optionstassertEqualtgetattr(R
tdisttcmdtattrtwaited((s1/sys/lib/python2.7/distutils/tests/test_upload.pyttest_finalize_optionsHs	
	cCs{|j|jt�t�}t|�}|j�|j|jd�d|_t|�}|j�|j|jd�dS(Ntxxx(	R"R#tPYPIRC_NOPASSWORDRRR$R%RR(R
R'R(((s1/sys/lib/python2.7/distutils/tests/test_upload.pyttest_saved_passwordTs	
	
cCs|j�}tjj|d�}|j|�dd|}}}|||fg}|j|jt�|jd|dd�\}}t|�}	|	j	�|	j
�|jd|jj
j�t|jj
j�}
|j|
dd�|j|
d	jd
��|j|jj
j�d�|j|jj
j�d�|jd|jj
jk�|jj
jd
}|jd|k�dS(NR,s2.6t
dist_filestauthorudédésdédésContent-lengtht2085sContent-typesmultipart/form-datatPOSTshttp://pypi.python.org/pypit
Authorizations
(tmkdtemptostpathtjoinR"R#tPYPIRC_LONG_PASSWORDtcreate_distRtensure_finalizedtruntassertInRR
tdatatdicttheadersR%t
assertTruet
startswitht
get_methodtget_full_urltassertFalse(R
ttmpR6tcommandt	pyversiontfilenameR/tpkg_dirR'R(R?tauth((s1/sys/lib/python2.7/distutils/tests/test_upload.pyttest_uploades(


(RRRRRR+R.RK(((s1/sys/lib/python2.7/distutils/tests/test_upload.pyR8s					cCs
tjt�S(N(tunittestt	makeSuiteR(((s1/sys/lib/python2.7/distutils/tests/test_upload.pyt
test_suitest__main__(t__doc__R5RLttest.test_supportRtdistutils.commandRRtdistutils.command.uploadtdistutils.coreRtdistutils.tests.test_configRRR8R-tobjectRRRNR(((s1/sys/lib/python2.7/distutils/tests/test_upload.pyt<module>sG	

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.