o
    ÌÄ.j
  ã                   @   sD   d Z ddlZej dg d¢¡dd„ ƒZej dg d¢¡d	d
„ ƒZdS )z¨
Test the DURATION property.

Not all events have an end.
Some events define no explicit end and some a DURATION.
RFC: https://www.kanzaki.com/docs/ical/duration.html

é    N)ÚdateÚcount))Ú20180110é   )Ú20180111r   )Ú20180112r   )Ú20180109r   )Ú20180114r   ))éâ  r   é   é
   r   ))r
   r   r   é   r   ))r
   r   r   é   r   ))r
   r   r   é	   r   ))r
   r   r   é   r   ))r
   r   é   r   ))r
   r   é   r   ))r
   r   é   r   c                 C   s    |j  | ¡}t|ƒ|ksJ ‚d S )N)ÚdurationÚatÚlen)r   r   Ú	calendarsÚevents© r   ú]/home/thesage/.local/lib/python3.10/site-packages/recurring_ical_events/test/test_duration.pyÚtest_events_expected   s   r   )r   ÚsummaryÚexpected_hours))Ú20190318úoriginal eventr   )Ú20190319zedited durationé   )Ú20190320r   r   c                 C   sh   | j  |¡}t|ƒdksJ ‚|d }|d j|d j  ¡ d }||d ks*J dƒ‚||ks2J dƒ‚d	S )
z1Test that the duration of an event can be edited.r   r   ÚDTENDÚDTSTARTi  ÚSUMMARYz we should have the correct eventz/the duration is only edited in the edited eventN)Úduration_editedr   r   ÚdtÚtotal_seconds)r   r   r   r   r   ÚeventÚevent_hoursr   r   r   Útest_duration_is_edited'   s   

ÿr+   )Ú__doc__ÚpytestÚmarkÚparametrizer   r+   r   r   r   r   Ú<module>   s    	þ
þ