HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/samba/tests/__pycache__/core.cpython-310.pyc
o

�/a�@s�dZddlZddlZddlZddlmZmZddlmZmZGdd�de�Z	Gdd�de�Z
Gd	d
�d
e�ZGdd�de�ZdS)
zSamba Python tests.�N)�arcfour_encrypt�string_to_byte_array)�TestCase�TestCaseInTempDirc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�SubstituteVarTestCasecCs|�dt�di��dS)N���assertEqual�samba�substitute_var��self�r�2/usr/lib/python3/dist-packages/samba/tests/core.py�
test_emptysz SubstituteVarTestCase.test_emptycC�|�dt�dddi��dS)Nzfoo bar�bar�blarrrrr�test_nothing ��z"SubstituteVarTestCase.test_nothingcCs|�dt�dddi��dS)Nzfoo blaz
foo ${bar}rrrrrrr�test_replace$rz"SubstituteVarTestCase.test_replacecCr)Nzfoo ${bdkjfhsdkfh sdkfh rrrrrrr�test_broken(rz!SubstituteVarTestCase.test_brokencCr)Nzfoo ${bla} gsffrrrrrrr�test_unknown_var,rz&SubstituteVarTestCase.test_unknown_varcCst�d�|�ttjd�dS)Nznothing to see herezNot subsituted: ${FOOBAR})r
�check_all_substituted�assertRaises�	Exceptionrrrr�test_check_all_substituted0s

�z0SubstituteVarTestCase.test_check_all_substitutedN)	�__name__�
__module__�__qualname__rrrrrrrrrrrsrc@�eZdZdd�ZdS)�ArcfourTestCasecCs&d}d}d}t||�}|�||�dS)Ns12345678s	abcdefghis	ڑZ�l׹ϙ)rr	)r
�key�plain�crypt_expected�crypt_calculatedrrr�test_arcfour_direct8s

z#ArcfourTestCase.test_arcfour_directN)rrrr&rrrrr!6�r!c@r )�StringToByteArrayTestCasecCs gd�}td�}|�||�dS)N)	����Z��l������uڑZ°l׹ϙ)rr	)r
�expected�
calculatedrrr�test_byte_arrayBsz)StringToByteArrayTestCase.test_byte_arrayN)rrrr4rrrrr(@r'r(c@r )�LdbExtensionTestsc	Csd|jd}t�|�}z |�ddd��|�d|jt�|d�dd��W~t�	|�dS~t�	|�w)Nz/searchone.ldbzfoo=dcr)�dnrsblar)�basedn�	attribute)
�tempdirr
�Ldb�addr	�	searchone�ldb�Dn�os�unlink)r
�path�lrrr�test_searchoneJs

��z LdbExtensionTests.test_searchoneN)rrrrCrrrrr5Hr'r5)
�__doc__r=r?r
rr�samba.testsrrrr!r(r5rrrr�<module>s