a
    cl_l	                     @   sD   d Z ddlZddlZddlmZmZ dd ZG dd dejjZ	dS )zTests for samba.kcc.graph    N)total_scheduleconvert_schedule_to_repltimesc                 C   sh   | d u rd S ddl m} | }d|_d|_d|_| }d|_d|_|g|_	|
 }| |_|g|_|S )Nr   )drsblobs         )Zsamba.dcerpcr   schedulesizeZ	bandwidthZnumberOfSchedulesZscheduleHeadertypeoffsetZheaderArrayZscheduleSlotsslotsZ	dataArray)timesr   r   headerdata r   7/usr/lib/python3/dist-packages/samba/tests/kcc/graph.pyntdsconn_schedule   s    r   c                   @   s   e Zd Zdd Zdd ZdS )GraphFunctionTestsc                 C   s   dgd }dgd dfdgd dfdgd dfdd	gd
 dft tdd dft tdd dffD ]\}}| t|| qdd S )N   T         i     iP     3   *            l         )listrangeassertEqualr   )selfr   totalr   r   r   test_total_schedule.   s    
z&GraphFunctionTests.test_total_schedulec                 C   s   dgd dgd fd dgd fdgd dgd fddgd d	gd ft td
d g dd ffD ] \}}t|}| t|| qbd S )Nr   r      r      f   r   
   :   r      )r   #   E   `      4   V   r   )r"   r#   r   r$   r   )r%   Zntdsconn_timesZ	repltimesr   r   r   r   "test_convert_schedule_to_repltimes9   s    

z5GraphFunctionTests.test_convert_schedule_to_repltimesN)__name__
__module____qualname__r'   r4   r   r   r   r   r   ,   s   r   )
__doc__ZsambaZsamba.testsZsamba.kcc.graphr   r   r   ZtestsZTestCaser   r   r   r   r   <module>   s
   