U
    j                  
   @   sn   d Z ddlZddlmZmZ ejddeddfdedd	fd
eddfdeddfgdd Zdd Zdd Z	dS )zTest the VALARM compatibility of RFC 9074.

See https://www.rfc-editor.org/rfc/rfc9074.html
and also https://github.com/collective/icalendar/issues/657
    N)	vDDDTypesvText)propclsfilealarm_indexUIDZrfc_9074_example_1
RELATED-TOZrfc_9074_example_2   ACKNOWLEDGEDrfc_9074_example_3	PROXIMITYrfc_9074_example_proximityc                 C   s,   | | }|j | }|| }t||s(tdS )z"Check the types of the properties.N)subcomponents
isinstanceAssertionError)eventsr   r   r   r   eventalarmvalue r   A/tmp/pip-unpacked-wheel-g40nyxg1/icalendar/tests/test_rfc_9074.pytest_calendar_types   s    
r   c                 C   sZ   | j jd }|d jtdks$t| j jd }|d dks@t|d jd dksVtd	S )
zCheck values of the alarms.r   r   Z20210302T152024Zr
   r	   z$8297C37D-BA2D-4476-91AE-C1EAA364F8E1ZRELTYPEZSNOOZEN)r   r   dtr   Z	from_icalr   params)r   Zalarm_1Zalarm_2r   r   r   test_snooze   s
    r   c                 C   sL   | j jd }|d dkstt|jdks.t|jd }|d dksHtdS )zCheck the proximity values.r   r   ZDEPARTr
   r   z123456-abcdef-98765432N)r   r   r   len)r   r   locationr   r   r   test_proximity&   s
    
r   )
__doc__ZpytestZicalendar.propr   r   markZparametrizer   r   r   r   r   r   r   <module>   s   



	
	