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

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


��Qc@s9dZddlZddlZddlZddlZddlZddlmZmZddl	m
Zddlm
Z
ddl
mZddlmZyddlZWnek
r�dZnXdZdZd	efd
��YZdefd��YZd
efd��YZd�Zedkr5ee��ndS(s%Tests for distutils.command.register.i�N(tcheck_warningstrun_unittest(tregister(tDistutilsSetupError(tPyPIRCCommandTestCases@[distutils]

index-servers =
    server1

[server1]
username:me
sN[distutils]
index-servers =
    pypi

[pypi]
username:tarek
password:password
t	RawInputscBs#eZdZd�Zdd�ZRS(sFakes user inputs.cGs||_d|_dS(Ni(tanswerstindex(tselfR((s3/sys/lib/python2.7/distutils/tests/test_register.pyt__init__,s	tcCs)z|j|jSWd|jd7_XdS(Ni(RR(Rtprompt((s3/sys/lib/python2.7/distutils/tests/test_register.pyt__call__0s(t__name__t
__module__t__doc__R	R(((s3/sys/lib/python2.7/distutils/tests/test_register.pyR*s	t
FakeOpenercBs2eZdZd�Zd�Zd�Zd�ZRS(sFakes a PyPI servercCs
g|_dS(N(treqs(R((s3/sys/lib/python2.7/distutils/tests/test_register.pyR	8scGs|S(N((Rtargs((s3/sys/lib/python2.7/distutils/tests/test_register.pyR;scCs|jj|�|S(N(Rtappend(Rtreq((s3/sys/lib/python2.7/distutils/tests/test_register.pytopen>scCsdS(Ntxxx((R((s3/sys/lib/python2.7/distutils/tests/test_register.pytreadBs(R
RRR	RRR(((s3/sys/lib/python2.7/distutils/tests/test_register.pyR6s
			tRegisterTestCasecBs�eZd�Zd�Zdd�Zd�Zd�Zd�Zd�Z	e
jedk	d�d��Z
e
jedk	d�d	��Zd
�ZRS(cCsTtt|�j�tj|_d�}|t_tj|_t�|_	t_dS(NcSsdS(Ntpassword((R((s3/sys/lib/python2.7/distutils/tests/test_register.pyt_getpassKs(
tsuperRtsetUptgetpasst_old_getpassturllib2tbuild_openert
old_openerRtconn(RR((s3/sys/lib/python2.7/distutils/tests/test_register.pyRGs		cCs/|jt_|jt_tt|�j�dS(N(RRR!RR RRttearDown(R((s3/sys/lib/python2.7/distutils/tests/test_register.pyR#QscCsW|dkr8idd6dd6dd6dd6dd6}n|j|�\}}t|�S(NRturltauthortauthor_emailtnametversion(tNonetcreate_distR(Rtmetadatatpkg_infotdist((s3/sys/lib/python2.7/distutils/tests/test_register.pyt_get_cmdVscCsj|j�}|jtjj|j��tddd�}|jt_	z|j
�Wdt`	X|jtjj|j��t|j�}z |j�}|j
|t�Wd|j�Xdd�}|t_	d|_|j
�|j
t|jj�d�t|jjdj�}t|jjdj�}|j
|d	|d	�|jd
|jjdjk�dS(Nt1ttarektyR
cSst|��dS(N(tAssertionError(R((s3/sys/lib/python2.7/distutils/tests/test_register.pyt_no_way�siiisContent-lengthR(R.t
assertTruetostpathtexiststrcRRtregister_modulet	raw_inputtrunRRtassertEqualt
WANTED_PYPIRCtcloset
show_responsetlenR"Rtdicttheaderstdata(RtcmdtinputstftcontentR3treq1treq2((s3/sys/lib/python2.7/distutils/tests/test_register.pyttest_create_pypirc^s,
		
cCsW|j|jt�|j�}|j�|j�|j�|j|jj	d�dS(NR(
t
write_fileR8tPYPIRC_NOPASSWORDR.t_set_configtfinalize_optionst
send_metadataR<tdistributionR(RRD((s3/sys/lib/python2.7/distutils/tests/test_register.pyttest_password_not_in_file�s


cCs�|j�}tddd�}|jt_z|j�Wdt`X|jt|jj	�d�|jj	d}t
|j�}|j|dd�|jd|j
k�dS(Nt2R0s[email protected]isContent-lengtht608(R.RRR9R:R;R<R@R"RRARBR4RC(RRDRERRB((s3/sys/lib/python2.7/distutils/tests/test_register.pyttest_registering�scCs�|j�}tdd�}|jt_z|j�Wdt`X|jt|jj	�d�|jj	d}t
|j�}|j|dd�|jd|j
k�dS(Nt3s[email protected]isContent-lengtht290R0(R.RRR9R:R;R<R@R"RRARBR4RC(RRDRERRB((s3/sys/lib/python2.7/distutils/tests/test_register.pyttest_password_reset�ssneeds docutilscCs�|ji�}|j�d|_|jt|j�idd6dd6dd6dd6dd6d	d
6}|j|�}|j�d|_|jt|j�d|d
<|j|�}|j�d|_tdd
d�}|jt_	z|j�Wdt`	X|j�}|j�tdd
d�}|jt_	z|j�Wdt`	Xidd6dd6dd6dd6dd6dd6dd
6}|j|�}|j�d|_tdd
d�}|jt_	z|j�Wdt`	XdS(NiRR$R%uéxéxéR&R'R(stitle
==

texttlong_descriptionstitle
=====

textR/R0R1uxxxuÉricunameuSomething about esszet ßtdescriptionuMore things about esszet ß(
R.tensure_finalizedtstricttassertRaisesRR;RRR9R:(RRDR+RE((s3/sys/lib/python2.7/distutils/tests/test_register.pyttest_strict�sR
	

	

	


	cCs�d}idd6dd6dd6dd6dd6|d6}|j|�}|j�t|_td	d
d�}|t_|jttd�|j	t
|j�dS(
Ns
:funkie:`str`RR$R%R&R'R(RXRRR0s[email protected]:(R.RZtTrueR[RR9R:t
addCleanuptdelattrR\RR;(RRYR+RDRE((s3/sys/lib/python2.7/distutils/tests/test_register.pyt&test_register_invalid_long_descriptions

		cCsR|j�}t��}tjd�|j�|jt|j�d�WdQXdS(Ntalwaysi(R.Rtwarningstsimplefiltertcheck_metadataR<R@(RRDtw((s3/sys/lib/python2.7/distutils/tests/test_register.pyttest_check_metadata_deprecateds


N(R
RRR#R)R.RJRQRTRWtunittestt
skipUnlesstdocutilsR]RaRg(((s3/sys/lib/python2.7/distutils/tests/test_register.pyREs	
		7			!B!cCs
tjt�S(N(Rht	makeSuiteR(((s3/sys/lib/python2.7/distutils/tests/test_register.pyt
test_suitest__main__(RR5RhRRRcttest.test_supportRRtdistutils.commandRR9tdistutils.command.registertdistutils.errorsRtdistutils.tests.test_configRRjtImportErrorR)RLR=tobjectRRRRlR
(((s3/sys/lib/python2.7/distutils/tests/test_register.pyt<module>s,



�

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].