U
    j                     @   s@   d Z ddlmZ ddlmZ ddlZdd Zdd Zd	d
 ZdS )zDTesting multiple VCALENDAR components and multiple VEVENT components    )vText)EventNc                 C   sz   | j j}t|dkstdd |d  D ddgks:tdd |d  D dddgks^t|d d	 td
ksvtdS )z!Check opening multiple calendars.   c                 S   s   g | ]
}|j qS  name.0compr   r   A/tmp/pip-unpacked-wheel-g40nyxg1/icalendar/tests/test_multiple.py
<listcomp>   s     z!test_multiple.<locals>.<listcomp>r   Z	VCALENDARZVEVENTc                 S   s   g | ]
}|j qS r   r   r   r   r   r   r      s        Zprodidz0-//Mozilla.org/NONSGML Mozilla Calendar V1.0//ENN)multipleZmultiple_calendar_componentslenAssertionErrorwalkr   )Z	calendarsZcalsr   r   r   test_multiple   s    "$r   c               	   C   s,   d} t t}tj| dd W 5 Q R X dS )z&Raises ValueError unless multiple=Truez1
BEGIN:VEVENT
END:VEVENT
BEGIN:VEVENT
END:VEVENT
F)r   NpytestZraises
ValueErrorr   Z	from_ical)Zevent_components	exceptionr   r   r   test_multiple_events   s    r   c               	   C   s$   t t} td W 5 Q R X dS )z'Raises ValueError if no component found Nr   )r   r   r   r   test_missing_event   s    r   )	__doc__Zicalendar.propr   Zicalendar.calr   r   r   r   r   r   r   r   r   <module>   s   