��Qc@sdZddlZddlZddlZddlZddlZddlmZddlmZddl m
Z
ddl mZddlm
Z
ddlmZd Zd
ZdZde
je
je
jejfd
��YZd�Zedkree��ndS(s"Tests for distutils.pypirc.pypirc.i�N(t
PyPIRCCommand(tDistribution(t
set_threshold(tWARN(tsupport(trun_unittests�[distutils]
index-servers =
server1
server2
[server1]
username:me
password:secret
[server2]
username:meagain
password: secret
realm:acme
repository:http://another.pypi/
s.[server-login]
username:tarek
password:secret
sI[distutils]
index-servers =
pypi
[pypi]
username:tarek
password:xxx
tPyPIRCCommandTestCasecBs,eZd�Zd�Zd�Zd�ZRS(cCs�tt|�j�|j�|_|jtjd<tjj|jd�|_ t
�|_dtfd��Y}||_
tt�|_dS(sPatches the environment.tHOMEs.pypirctcommandcBs eZd�Zd�ZeZRS(cSstj||�dS(N(Rt__init__(tselftdist((s1/sys/lib/python2.7/distutils/tests/test_config.pyR AscSsdS(N((R
((s1/sys/lib/python2.7/distutils/tests/test_config.pytinitialize_optionsCs(t__name__t
__module__R Rtfinalize_options(((s1/sys/lib/python2.7/distutils/tests/test_config.pyR@s N(tsuperRtsetUptmkdtempttmp_dirtostenvirontpathtjointrcRRRt_cmdRRt
old_threshold(R
R((s1/sys/lib/python2.7/distutils/tests/test_config.pyR8s cCs$t|j�tt|�j�dS(sRemoves the patch.N(RRRRttearDown(R
((s1/sys/lib/python2.7/distutils/tests/test_config.pyRJs
cCs�|j|jt�|j|j�}|j�}|j�}|j�d
ddddg}|j||�|j|jt �|j�}|j�}|j�dddddg}|j||�dS(Ntpasswordtsecrettrealmtpypit
repositoryshttp://pypi.python.org/pypitservertserver1tusernametmesserver-loginttarek(RR(RR(R shttp://pypi.python.org/pypi(R!R"(R#R$(RR(RR(R shttp://pypi.python.org/pypi(R!sserver-login(R#R%(
t
write_fileRtPYPIRCRRt_read_pypirctitemstsorttassertEqualt
PYPIRC_OLD(R
tcmdtconfigtwaited((s1/sys/lib/python2.7/distutils/tests/test_config.pyttest_server_registrationOs"
cCs�|j|j�}|j�}|jtjj|��|jdd�|jtjj|��t|�}z |j �}|j
|t�Wd|j�XdS(NR%txxx(
RRt_get_rc_filet
assertTrueRRtexistst
_store_pypirctopentreadR+tWANTEDtclose(R
R-Rtftcontent((s1/sys/lib/python2.7/distutils/tests/test_config.pyttest_server_empty_registrationjs(R
RRRR0R<(((s1/sys/lib/python2.7/distutils/tests/test_config.pyR3s cCs
tjt�S(N(tunittestt makeSuiteR(((s1/sys/lib/python2.7/distutils/tests/test_config.pyt
test_suitewst__main__(t__doc__tsysRR=ttempfiletshutiltdistutils.coreRRt
distutils.logRRtdistutils.testsRttest.test_supportRR'R,R8tTempdirManagertLoggingSilencertEnvironGuardtTestCaseRR?R
(((s1/sys/lib/python2.7/distutils/tests/test_config.pyt<module>s*
A
|