o
    .j                     @   s   d dl Z d dlZdd Zdd Zdd Zdd	 Zg d
Zejdedd Z	ejdg ddd Z
dd Zdd Zejdg ddd ZdS )    Nc              	   C   sL   t  ddddddd}|j|jd d	}|j|jd d	}| j|| d
S )zlThis calendar threw an exception.

    TypeError: can't compare offset-naive and offset-aware datetimes
               4   
   iH    )yearN)datetimereplacer	   fablab_cottbusbetween)	calendarstodayone_year_aheadone_year_before r   ]/home/thesage/.local/lib/python3.10/site-packages/recurring_ical_events/test/test_examples.pytest_fablab_cottbus   s   r   c                 C   s^   d}d}| j ||}|D ]}|d j}|d j|d j }td| d|  q|s-J dS )zTThe examples from the README should be tested so we make no
    false promises.
    )r   r      )r   r   r   DTSTARTDTENDzstart z
 duration N)one_day_event_repeat_every_dayr   dtprint)r   
start_dateend_dateeventseventstartdurationr   r   r   test_example_from_README   s   
r!   c                 C   s   t | j  dS )zIThis calendar has events which have no DTEND.

    KeyError: 'DTEND'
    N)listdiscourse_no_dtendallr   r   r   r   test_no_dtend!   s   r&   c                 C   sN   | j d}t|dksJ |d }|d dksJ t|d jtjs%J d S )N)i  r      r   r   SUMMARYz,Germany: Mother's Day [Not a public holiday]r   )Germanyatlen
isinstancer   r
   date)r   r   r   r   r   r    test_date_events_are_in_the_date)   s
   r.   ))  	      )r/   r      )r/   r'      )r/         )r   r   r4   )r   r      )r      r0   )r   r7      )r   r      )r   r   r6   )r   r      )r      r1   r-   c                 C   s    | j |}t|dksJ d S )Nr   )machbar_16_feb_2019r*   r+   )r   r-   r   r   r   r   test_events_are_scheduledA   s   r=   month))r/   r0   )r/   r   )r/   r'   )r/   r4   )r   r   )r   r7   )r   r   )r   r   )r   r   )r   r;   )r      c                    sH    fddt D }t|}| j }dd |D }t||ks"J d S )Nc                    s    g | ]}|d d  kr|qS )Nr7   r   ).0r-   r>   r   r   
<listcomp>X   s     z5test_no_more_events_are_scheduled.<locals>.<listcomp>c                 S   s   g | ]
}d |d v r|qS )z	mB-onTourr(   r   )r@   r   r   r   r   rB   [   s    )mb_on_tour_datesr+   r<   r*   )r   r>   datesnumber_of_datesr   	mb_eventsr   rA   r   !test_no_more_events_are_scheduledG   s
   rG   c                 C   s    | j d}t|dksJ dS )zfTest the calendar from
    https://www.calendarlabs.com/ical-calendar/ics/46/Germany_Holidays.ics
    i  r3   N)Germany_Holidaysr*   r+   )r   holidaysr   r   r   test_german_holidays_   s   rJ   c                 C   s   | j dg ks
J dS )zsThe EXDATE can be a date, too.

    See https://github.com/niccokunzmann/python-recurring-ical-events/pull/121
    20231216N)date_excluder*   r%   r   r   r   test_exdate_dateg   s   rM   )r-   count))20240923r   )20240924r   )20240925r   )20240926r   )20240927r   c                 C   s   t | j||ksJ dS )z4Make sure that events can be moved to the same time.N)r+   !same_event_recurring_at_same_timer*   )r   r-   rN   r   r   r   test_same_events_at_same_timeo   s   rU   )r
   pytestr   r!   r&   r.   rC   markparametrizer=   rG   rJ   rM   rU   r   r   r   r   <module>   s*    


