o
    .j
                  
   @   s   d Z ddlZddlZddlmZmZmZmZmZm	Z	m
Z
 dd Zejdedf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	eee
egdd ZdS )z3tests ensuring that *the* way of doing things works    N)AlarmAvailability	AvailableCalendarEventTimezoneTodoc                 C   sR  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sJ dS )zMcreate a calendar with events that contain unicode characters in their fields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-RELCALID12345DTSTARTi  
   r   )tzinfoDTEND   CREATEDUID123456SUMMARYu!   Non-ASCII Test: ÄÖÜ äöü €DESCRIPTIONz3icalendar should be able to de/serialize non-ascii.LOCATIONu
   Tribstrülu   åäöu   äöüßÄÖÜN)r   addr   datetimeadd_componentto_ical$created_calendar_with_unicode_fieldsraw_ics)	calendarsutccaleventevent1event2 r#   R/home/thesage/.local/lib/python3.10/site-packages/icalendar/tests/test_examples.py*test_creating_calendar_with_unicode_fields
   s.      
 

r%   	componentexampler(   example.icsevent_with_rsvppacific_fijic              
   C   s>   t |t|t|t|t|i}||}	|| | }
|	|
ksJ dS )z'Check that the examples function works.N)r   r   r   r   r   r(   )tzpr   	timezoneseventstodosr'   r(   alarmsmappingexample_componentexpected_componentr#   r#   r$   test_component_has_examples,   s   
r4   c                  C   sJ   t t} td W d   n1 sw   Y  dt| jv s#J dS )zWe need a bit of guidance here.zdoes not existNr)   )pytestraises
ValueErrorr   r(   strvalue)er#   r#   r$   &test_invalid_examples_lists_the_othersF   s   r;   r'   c                 C   s   |   }t|| sJ dS )z%Check that we have a default example.N)r(   
isinstancer&   r#   r#   r$   test_default_exampleM   s   r=   )__doc__r   r5   	icalendarr   r   r   r   r   r   r   r%   markparametrizer4   r;   r=   r#   r#   r#   r$   <module>   s(    $"

