File: //lib/python3/dist-packages/samba/tests/dcerpc/__pycache__/rpc_talloc.cpython-310.pyc
o
�/aC � @ s^ d Z ddlZej�dd� ddlZddlZddlmZ ddlZe� � G dd� dej
j�ZdS )zGTests for the talloc handling in the generated Python DCE/RPC bindings.� Nz
bin/python)�drsuapic @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
S )�TallocTestsz3test talloc behaviour of pidl generated python codec C s, t �|�}|du r|| j8 }| �||� dS )z4check that the number of allocated blocks is correctN)�talloc�total_blocks�initial_blocks�assertEqual)�self�object�num_expected�nblocks� r �?/usr/lib/python3/dist-packages/samba/tests/dcerpc/rpc_talloc.py�check_blocks+ s
zTallocTests.check_blocksc C sB t �� }| �|d� g d�}d|_||_t|�|_| �|d� |S )z-get a list of attributes for RODC replication� )r � � r )r �DsPartialAttributeSetr �version�attids�len�
num_attids)r �partial_attribute_setr r r r
�get_rodc_partial_attribute_set2 s
z*TallocTests.get_rodc_partial_attribute_setc C sb | � � }| �|d� t�� }| �|d� | �d d� ||_|jjd dkr)td��| �d d� d S )Nr r � zWrong value in attids[2]� )r r r �DsGetNCChangesRequest8r r � Exception)r �pas�req8r r r
�pas_testD s zTallocTests.pas_testc C s0 t �d �| _| �d d� | �� | �d d� d S )Nr )r r r r r )r r r r
�test_runR s zTallocTests.test_runN)�__name__�
__module__�__qualname__�__doc__r r r r r r r r
r ( s r )
r$ �sys�path�insert�samba�samba.tests�samba.dcerpcr r �enable_null_tracking�tests�TestCaser r r r r
�<module> s