
    bC                         d Z ddlZej                            dd           ddlZddlZddlmZ ddlZ ej	                      G d dej
        j                  ZdS )zGTests for the talloc handling in the generated Python DCE/RPC bindings.    Nz
bin/python)drsuapic                   *    e Zd ZdZd Zd Zd Zd ZdS )TallocTestsz3test talloc behaviour of pidl generated python codec                 r    t          j        |          }|
|| j        z  }|                     ||           dS )z4check that the number of allocated blocks is correctN)talloctotal_blocksinitial_blocksassertEqual)selfobjectnum_expectednblockss       ?/usr/lib/python3/dist-packages/samba/tests/dcerpc/rpc_talloc.pycheck_blockszTallocTests.check_blocks+   s@    %f-->t**G,/////    c                     t          j                    }|                     |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   s      r   get_rodc_partial_attribute_setz*TallocTests.get_rodc_partial_attribute_set2   ss     ' = ? ? 	/333()%+1$+.v;;( 	/333$$r   c                 \   |                                  }|                     |d           t          j                    }|                     |d           |                     d d           ||_        |j        j        d         dk    rt          d          |                     d d           d S )Nr   r      zWrong value in attids[2]   )r   r   r   DsGetNCChangesRequest8r   r   	Exception)r   pasreq8s      r   pas_testzTallocTests.pas_testD   s    1133#q!!!-//$""" 	$"""%("%,Q/1446777$"""""r   c                     t          j        d           | _        |                     d d           |                                  |                     d d           d S )Nr   )r   r   r	   r   r$   )r   s    r   test_runzTallocTests.test_runR   sT    $1$77$"""$"""""r   N)__name__
__module____qualname____doc__r   r   r$   r&    r   r   r   r   (   sV        ==0 0 0% % %$# # ## # # # #r   r   )r*   syspathinsertsambasamba.testssamba.dcerpcr   r   enable_null_trackingtestsTestCaser   r+   r   r   <module>r5      s   4 N M 



 <                             .# .# .# .# .#%+& .# .# .# .# .#r   