
    i                     $   d Z ddlZddlmZmZmZ ddlZddlmZmZm	Z	 ddl
mZ defdZdefdZd	 Zd
 ZdefdZd Zej                            d e ed                     e ed                     e ed                     e ed                    g          d             Zej                            ej        dk    d          d             Zej                            ej        dk    d          d             ZdS )aF  Test that we can identify all timezones.

Timezones can be removed from ./timezone_ids.py if they make the tests fail:
Timezone information changes over time and can be dependent on the operating system's
timezone database (zoneinfo, dateutil) or the package (pytz).
We want to make sure we can roughly identify most of them.
    N)datetime	timedeltatimezone)is_utctzid_from_tzinfotzids_from_tzinfo)TZPtzpc                 R    | t          |                    |                     v sJ dS )z:Check that all those zoneinfo timezones can be identified.Nr   r   )tzidzoneinfo_onlyr
   s      g/root/projects/butler/venv/lib/python3.11/site-packages/icalendar/tests/test_timezone_identification.pytest_can_identify_zoneinfor      .    $S\\$%7%788888888    c                 R    | t          |                    |                     v sJ dS )z6Check that all those pytz timezones can be identified.Nr   )r   	pytz_onlyr
   s      r   test_can_identify_pytzr      r   r   c                 J    ddl m} | t           ||                     v sJ dS )z:Check that all those dateutil timezones can be identified.r   gettzN)dateutil.tzr   r   )r   r   s     r   test_can_identify_dateutilr      s<    !!!!!!$UU4[[11111111r   c                 x    dt          |           v sJ t          |           dk    sJ t          |           sJ dS )z0Test UTC because it is handled in a special way.UTCN)r   r   r   )utcs    r   test_utc_is_identifiedr   #   sM    %c******C  E))))#;;r   c                 N    t          |                     d                    rJ dS )z$If we have an offset, it is not utc.zEurope/BerlinN)r   r   )r
   s    r   test_some_timezones_are_not_utcr    *   s(    cll?334444444r   c                      t          t          d                    } t          |           sJ t          t          ddddddd|                     sJ dS )z!If we are at 0 offset, it is utc.r   hoursi     tzinfoN)r   r   r   r   r%   s    r   )test_some_timezones_are_recognized_as_utcr'   /   s_    ia((())F&>>(4Aq!Q&AAABBBBBBBr   r&   r$   r"      c                 (    t          |           sJ dS )z%We should get a name that we can use.N)r   r%   s    r   *test_getting_a_timezone_name_for_timezonesr,   6   s     F#######r   win32ztzwin only exists on Windows)reasonc                      ddl m}   | d          }dt          |          v sJ t          |          dk    sJ t	          |          sJ dS )a1  tzwin('UTC') from dateutil.tz.gettz('UTC') must be recognized as UTC.

    On Windows, dateutil.tz.gettz('UTC') returns tzwin('UTC') whose tzname()
    is 'Coordinated Universal Time', not 'UTC'. This must still be identified
    as UTC so that datetimes use the Z suffix instead of a TZID parameter.
    r   r   r   N)r   r   r   r   r   r   r&   s     r   test_tzwin_utc_is_identifiedr1   D   sn     "!!!!!U5\\F%f------F##u,,,,&>>r   c                  R    ddl m}   | d          }t          |          dk    sJ dS )zAtzwin for a non-UTC Windows timezone maps to its IANA equivalent.r   r   zEastern Standard TimezAmerica/New_YorkN)r   r   r   r0   s     r    test_tzwin_non_utc_is_identifiedr3   T   sF     "!!!!!U*++FF##'9999999r   )__doc__sysr   r   r   pytesticalendar.timezoner   r   r   icalendar.timezone.tzpr	   r   r   r   r   r    r'   markparametrizer,   skipifplatformr1   r3    r   r   <module>r>      s    


 2 2 2 2 2 2 2 2 2 2  J J J J J J J J J J & & & & & &9 9 9 9 9
9 9 9 9 9
2 2 2  5 5 5 5 5
C C C ###$$$$$%%###$$$$$%%	 $ $ $
 CLG+4RSS  TS CLG+4RSS: : TS: : :r   