o
    .j
                     @   s   d Z ddlmZmZ ddlmZ ddlmZ ddlZddlm	Z	m
Z
mZmZmZ ddlmZ ddlmZ dd	lmZ erBdd
lmZ eje
edddeddeeddeddgddd ZejddeegdefddZdefddZdd ZdS )zETesting functionality that is common to date and time property types.    )datetimetime)TYPE_CHECKING)ZoneInfoN)	Component	vDatetime	vDDDLists	vDDDTypesvTime)
to_unicode)	VPROPERTY)is_utc)Eventi     UTC)tzinfo)paramsc                 C   s   | j S )N)param)request r   \/home/thesage/.local/lib/python3.10/site-packages/icalendar/tests/prop/test_date_and_time.pyutc_prop   s   r   convertc                 C   sx   |r|| j } | jjrJ dt }|d|  |d|  |d|  |d|  |  }t| d|vs:J dS )z7Check that the VALUE parameter is correctly determined.z-UTC datetimes must not carry a TZID parameterzX-PROPDTSTAMPDTSTARTDUETZIDN)dtr   tzidr   addto_icaldecodeprint)r   r   	componenticalr   r   r   9test_setting_a_utc_datetime_value_does_not_include_a_TZID   s   
r%   c                 C   s   t |  }|dsJ dS )a  Test that the Z is appended.

    :rfc:`5545`, TIME:
        UTC time, or absolute time, is identified by a LATIN CAPITAL
        LETTER Z suffix character, the UTC designator, appended to the
        time value.  For example, the following represents 07:00 AM UTC:

        .. code-block:: text

            070000Z

        The "TZID" property parameter MUST NOT be applied to TIME
        properties whose time values are specified in UTC.

    :rfc:`5545`, DATE-TIME:
        The date with UTC time, or absolute time, is identified by a LATIN
        CAPITAL LETTER Z suffix character, the UTC designator, appended to
        the time value.  For example, the following represents January 19,
        1998, at 0700 UTC:

        .. code-block:: text

            19980119T070000Z

        The "TZID" property parameter MUST NOT be applied to DATE-TIME
        properties whose time values are specified in UTC.

    ZN)r   r    endswith)r   r$   r   r   r   *test_converting_to_utc_puts_a_z_in_the_end/   s   r(   c                 C   s    | j }|d }t|jsJ dS )z5Check that UTC values are still propertly serialized.r   N)issue_156_RDATE_with_PERIODr   r   )eventsevent	utc_valuer   r   r   test_reformed_UTC_serializationP   s   r-   )__doc__r   r   typingr   zoneinfor   pytest	icalendarr   r   r   r	   r
   icalendar.parser_toolsr   icalendar.propr   icalendar.timezone.tzidr   icalendar.cal.eventr   fixturer   markparametrizer%   r(   r-   r   r   r   r   <module>   s.    
!