U
    j                     @  s   d Z ddlmZ ddlmZmZ ddlmZ ddlZddlm	Z	 erPddl
mZ e dd	d
dZddddZddddZdS )zoParse the calendar and make sure the timezone is used.

See https://github.com/collective/icalendar/issues/218
    )annotations)datetime	timedelta)TYPE_CHECKINGN)tzid_from_dt)Eventr   )returnc                 C  s   | j jd S )zThe event to check.r   )Zissue_218_bad_tzidevents)Z	calendars r
   Q/tmp/pip-unpacked-wheel-g40nyxg1/icalendar/tests/test_issue_218_parse_calendar.pyevent   s    r   r   c                 C  sH   | j jddtdddddks"t| jjddtdddddksDtdS )	zDThe calendar should be parsed and the start and end have a timezone.N)tzinfoi           r      )startreplacer   AssertionErrorendr   r
   r
   r   test_event_has_start_and_end   s    "r   c                 C  sB   | j j| jjkstt| j dks&t| j  tddks>tdS )zThe event uses a timezone.zUTC+11   )hoursN)r   r   r   r   r   	utcoffsetr   r   r
   r
   r   test_timezone   s    r   )__doc__
__future__r   r   r   typingr   ZpytestZicalendar.timezone.tzidr   Z	icalendarr   Zfixturer   r   r   r
   r
   r
   r   <module>   s   