%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/mailman/tests/
Upload File :
Create Path :
Current File : //lib/mailman/tests/test_security_mgr.pyc

�
�ac@s�dZddlZddlZddlZddlZyddlZWnek
r_dZnXddlmZyddl	m
Z
Wnek
r�ddlZnXddl	mZddl	m
Z
ddl	mZddlmZmZdd	lmZd
�Zdefd��YZd
efd��YZdefd��YZdefd��YZd�Zedkr�ejdd�ndS(s*Unit tests for Mailman/SecurityManager.py
i����N(tStringIO(t__init__(tmm_cfg(tUtils(tErrors(tmd5_newtsha_new(tTestBasecCst|�j�S(N(Rt	hexdigest(t	plaintext((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pytpassword-stTestSecurityManagercBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs3|j}||jjd�||jji�dS(N(tassertEqualt_mlisttmod_passwordtNonet	passwords(tselfteq((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_init_vars3s	cCsX|j}|jt|jtj�|jddd�|j|jtjd�d�dS(Nsaperson@dom.ainR
txxXXxxs _xtest+user+aperson--at--dom.ain(s _xtest+user+aperson--at--dom.ainR(R
tassertRaisest	TypeErrortAuthContextInfoRtAuthUsertaddNewMemberR(Rtmlist((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_auth_context_info_authuser8s	cCs2|j}d|_|j|jtj�d�dS(NtyyYYyys_xtest+moderator(s_xtest+moderatorR(R
RRRRtAuthListModerator(RR((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_auth_context_moderatorAs
		cCs2|j}d|_|j|jtj�d�dS(NtzzZZzzs_xtest+admin(s_xtest+adminR(R
R
RRRt
AuthListAdmin(RR((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_auth_context_adminHs
		cCs2|j}d|_|j|jtj�d�dS(NtaaAAaas_xtest+admin(s_xtest+adminR"(R
R
RRRt
AuthSiteAdmin(RR((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_auth_context_siteOs
		cCs |j|jjd�d�dS(Ntfoo(NN(RR
RR(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_auth_context_huhVs(t__name__t
__module__RRRR!R$R&(((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyR2s						tTestAuthenticatecBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�ZRS(cCs7tj|�tjddd�tjddd�dS(NtbbBBbbt	siteadminitccCCcci(RtsetUpRtset_global_password(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyR-^s
cCs�ytjtj�Wn+tk
rA}|jtjkrB�qBnXytjtj�Wn+tk
r�}|jtjkr��q�nXtj	|�dS(N(
tostunlinkRtSITE_PW_FILEtOSErrorterrnotENOENTtLISTCREATOR_PW_FILERttearDown(Rte((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyR6cs

cCs,|j|jjtjgd�tj�dS(NR,(RR
tAuthenticateRtAuthCreator(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_auth_creatornscCs,|j|jjtjgd�tj�dS(Ntxxxxxx(RR
R8RR9tUnAuthorized(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_auth_creator_unauthrscCs,|j|jjtjgd�tj�dS(NR*(RR
R8RR#(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_auth_site_adminvscCs,|j|jjtjgd�tj�dS(NR;(RR
R8RR#R<(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_auth_site_admin_unauthzscCs>td�|j_|j|jjtjgd�tj�dS(NtttTTtt(R
R
RR8RR (R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_list_admin~scCs>td�|j_|j|jjtjgd�tj�dS(NR@R;(R
R
RR8RR R<(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_list_admin_unauth�scCs�|j}|j}td�j�|_||jtjgd�tj�||jtd��tr�tjdd�|_||jjtjgd�tj�||jtd��ndS(NtssSSsstrrRRrrtzc(	RR
RtdigestR
R8RR tcrypt(RRR((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_list_admin_upgrade�s			cCs�|j}|j}td�j�|_||jtjgd�tj�||jtd�j��t	r�t	j	dd�|_}||jjtjgd�tj�||j|�ndS(NRCR;RDRE(
RR
RRFR
R8RR R<RG(RRRtcrypted((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_list_admin_oldstyle_unauth�s			cCs>td�|j_|j|jjtjgd�tj�dS(NtmmMMmm(R
R
RRR8RR(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_list_moderator�scCsH|j}|jddd�|j|jtjgdd�tj�dS(Nsaperson@dom.ainR
tnosrepa(R
RRR8RR(RR((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyt	test_user�s	cCsH|j}|jddd�|j|jtjgdd�tj�dS(Nsaperson@dom.ainR
RMsbperson@dom.ain(R
RRR8RRR<(RR((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_wrong_user�s
	cCsE|j}|jddd�|j|jtjgd�tj�dS(Nsaperson@dom.ainR
RM(R
RRR8RRR<(RR((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_no_user�s
	cCsH|j}|jddd�|j|jtjgdd�tj�dS(Nsaperson@dom.ainR
RMR;(R
RRR8RRR<(RR((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_user_unauth�s
	cCs&|jt|jjdgdd�dS(NtspoogeR;szperson@dom.ain(Rt
ValueErrorR
R8(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_value_error�s(R'R(R-R6R:R=R>R?RARBRHRJRLRNRORPRQRT(((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyR)]s 															t
StripperIOcBseZdZd�ZRS(sSet-Cookie: cCs<|j|j�r(|t|j�}ntj||�dS(N(t
startswithtHEADtlenRtwrite(Rts((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyRY�s(R'R(RWRY(((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyRU�stTestWebAuthenticatecBsGeZd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs�tj|�tjddd�tjddd�|j}td�|_|jddd	�t�}||j	t
j�IJ||j	t
j�IJ||j	t
j
�IJ||j	t
jd�IJ|j�}|tjd
<dS(NR*R+iR,itabcdefgsaperson@dom.ainR
tqqQQqqtHTTP_COOKIE(RR-RR.R
R
RRRUt
MakeCookieRR#R RRtgetvalueR/tenviron(RRtsfptcookie((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyR-�s
		cCs�ytjtj�Wn+tk
rA}|jtjkrB�qBnXytjtj�Wn+tk
r�}|jtjkr��q�nXtjd=t	j
|�dS(NR^(R/R0RR1R2R3R4R5RaRR6(RR7((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyR6�s


cCs)|j|jjtjgd�d�dS(NR;i(RR
tWebAuthenticateRR#(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyR>�scCs)|j|jjtjgd�d�dS(NR;i(RR
RdRR (R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyRA�scCs)|j|jjtjgd�d�dS(NR;i(RR
RdRR(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyRL�scCs)|j|jjtjgd�d�dS(NR;i(RR
RdRR(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyRN�scCs<|jjd�|j|jjtjgdd�d�dS(Nsaperson@dom.ainR;i(R
tremoveMemberRRdRR(R((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyttest_not_a_users(	R'R(R-R6R>RARLRNRf(((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyR[�s						cCsRtj�}|jtjt��|jtjt��|jtjt��|S(N(tunittestt	TestSuitetaddTestt	makeSuiteRR)R[(tsuite((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyRk
s
t__main__tdefaultTestRk(t__doc__R/RgR3tCookieRGtImportErrorRRtMailmanRtpathsRRRt
Mailman.UtilsRRRR
RR)RUR[RkR'tmain(((se/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/tests/test_security_mgr.pyt<module>s4


	+m;		

Zerion Mini Shell 1.0