U
    j
                     @   s   d Z ddlZddlZddlmZmZmZ dd Zej	dedfedfed	fed
fgdd Z
dd Zej	deeegdd ZdS )z3tests ensuring that *the* way of doing things works    N)CalendarEventTimezonec                 C   sT  t  }|dd |dd |dd |dd |d	d
 t }|dtjdddddd|d |dtjdddddd|d |dtjdddddd|d |dd |dd |dd |dd || t }|dtjdddddd|d |dd || t }|dd || | | jjksPtdS )zMcreate a calendar with events that contain unicode characters in their fieldsZPRODIDu+   -//Plönë.org//NONSGML plone.app.event//ENVERSIONz2.0zX-WR-CALNAMEu   äöü ÄÖÜ €zX-WR-CALDESCu!   test non ascii: äöü ÄÖÜ €zX-WR-RELCALIDZ12345ZDTSTARTi  
   r   )tzinfoZDTEND   CREATEDUIDZ123456ZSUMMARYu!   Non-ASCII Test: ÄÖÜ äöü €ZDESCRIPTIONz3icalendar should be able to de/serialize non-ascii.ZLOCATIONu
   Tribstrülu   åäöu   äöüßÄÖÜN)	r   addr   datetimeZadd_componentZto_icalZ$created_calendar_with_unicode_fieldsZraw_icsAssertionError)	calendarsutccaleventZevent1Zevent2 r   A/tmp/pip-unpacked-wheel-g40nyxg1/icalendar/tests/test_examples.py*test_creating_calendar_with_unicode_fields
   s.       
 

r   	componentexampler   example.icsZevent_with_rsvpZpacific_fijic           	      C   s6   t |t|t|i}||}|| | }||ks2tdS )z'Check that the examples function works.N)r   r   r   r   r   )	Ztzpr   Z	timezoneseventsr   r   mappingZexample_componentZexpected_componentr   r   r   test_component_has_examples,   s    
r   c               	   C   s6   t t} td W 5 Q R X dt| jks2tdS )zWe need a bit of guidance here.zdoes not existr   N)pytestZraises
ValueErrorr   r   strvaluer   )er   r   r   &test_invalid_examples_lists_the_others=   s    r!   r   c                 C   s   |   }t|| stdS )z%Check that we have a default example.N)r   
isinstancer   r   r   r   r   test_default_exampleD   s    r#   )__doc__r   r   Z	icalendarr   r   r   r   markZparametrizer   r!   r#   r   r   r   r   <module>   s    "	
