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: //usr/lib/python3/dist-packages/samba/tests/dcerpc/__pycache__/string_tests.cpython-310.pyc
o

�/a(�@stdZddlmZddlZddlmZmZddlZddl	Z	Gdd�de
�ZGdd�dejj
�ZGd	d
�d
ejj
�ZdS)zOTests for string and unicode handling in PIDL generated bindings
samba.dcerpc.*�)�drsblobsN)�
ndr_unpack�ndr_packc@seZdZdS)�
TestExceptionN)�__name__�
__module__�__qualname__�r	r	�A/usr/lib/python3/dist-packages/samba/tests/dcerpc/string_tests.pyrsrcsPeZdZ�fdd�Z�fdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)�StringTestscs$tt|���t��t��|_dS�N)�superr�setUp�talloc�enable_null_tracking�total_blocks�startup_blocks��self��	__class__r	r
r"szStringTests.setUpcs>tt|���t��t��|jkrt��|�	d�dSdS)Nz it appears we are leaking memory)
r
r�tearDown�gc�collectrrr�report_full�failrrr	r
r's�zStringTests.tearDowncCs�t��}d|_d|_t��|�|�|�|jd�|�|jd�d|_d|_|�|jd�|�|jd�d|_|�|jd�|�|j�dS)Nzhello.example.comzgoodbye.example.com�)	r�repsFromTo2OtherInfo�	dns_name1�	dns_name2rr�assertIsNotNone�assertEqual�assertIsNone�r�infor	r	r
�test_string_from_python.s
z#StringTests.test_string_from_pythoncCs$z|��t��tyYdSwr)r%rrr	r	r
�test_string_with_exceptionBs�z&StringTests.test_string_with_exceptioncCs@dd�}|�}t��|�|�|�|jd�|�|jd�dS)NcSst��}d|_d|_|S�N�
1.example.com�
2.example.com)rrrr)r$r	r	r
�get_infoJsz>StringTests.test_string_from_python_function.<locals>.get_infor(r))rrr r!rr)rr*r$r	r	r
� test_string_from_python_functionIs
z,StringTests.test_string_from_python_functioncCs�t��}d|_d|_t��|�|�|�|jd�|�|jd�|jd7_|jd;_|�|jd�|�|jd�~dS)Nr(z%s.example.comz.co.nz�z1.example.com.co.nzr))rrrrrrr r!r#r	r	r
�test_string_modify_in_placeVs
z'StringTests.test_string_modify_in_placecCsdt��t��}d|_d|_d|_z|`Wn	tyYnw|�|�|�|j�|�|j�dSr')	rrrrrr�AttributeErrorr r"r#r	r	r
�test_string_deleteds�
zStringTests.test_string_delete)rrrrrr%r&r+r-r/�
__classcell__r	r	rr
r s
rc@seZdZdZdd�ZdS)�StringTestsWithoutLeakCheckz�We know that the ndr unpacking test leaves stuff in the
    autofree_context, and we don't want to worry about that. So for
    this test we don't make meory leak assertions.cCsZt��}d|_d|_t|�}t��ttj|�}|�|�|�	|jd�|�	|jd�dSr')
rrrrrrrrr r!)rr$�packed�
info_unpackedr	r	r
�test_string_from_ndrys
z0StringTestsWithoutLeakCheck.test_string_from_ndrN)rrr�__doc__r4r	r	r	r
r1tsr1)r5�samba.dcerpcr�samba.tests�samba�	samba.ndrrrrr�	Exceptionr�tests�TestCaserr1r	r	r	r
�<module>sT