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    "üþ	
