
    ;e                    L   	 d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlmZ d dlmZmZmZmZmZmZmZmZmZ d dlmZ d dlmZmZmZmZ d dlZ d dlm!Z!m"Z" d dlm#Z# d dlm$Z$ d d	lm%Z% d d
lm&Z& d dlm'Z' d dlm(Z(mZ d dl%Z)	 d dl*Z*n# e+$ r dZ*Y nw xY wd dl,Z,ej-        ej.        hZ/d  e0ej1        dz             D             Z2dddi g dfZ3 e4d          Z5 e4d          Z6 G d dej7                  Z8 G d de$          Z9 G d de9          Z: G d de:          Z; G d de$          Z< G d d ej7                  Z= G d! d"ej7                  Z> G d# d$          Z? G d% d&e?ej7                  Z@ G d' d(ej7                  ZA G d) d*e(          ZB G d+ d,e?ej7                  ZC G d- d.e          ZD G d/ d0eC          ZE G d1 d2eE          ZF G d3 d4e%          ZG G d5 d6e?ej7                  ZH G d7 d8          ZI G d9 d:eHeIej7                  ZJ G d; d<eEeIej7                  ZKd= ZL e#d           ZM e#d>          ZN e#d?          ZO e#d@          ZP eddAddB          ZQ edddCd          ZR G dD dEe$          ZS eSdFdGdHdI          ZT eSdJdKdLdM          ZU eSdNdOdPdQ          ZV eSdRdSdTdU          ZW e9d dVd           ZX e9dWdXd           ZY G dY dZej7                  ZZ G d[ d\ej7                  Z[ G d] d^e$          Z\ G d_ d`e\          Z] e]dFdadHdI          Z^ e]dJdbdLdM          Z_ e]dNdcdPdQ          Z` e]dRdddTdU          Za G de dfe$          Zb G dg dhej7                  Zc e#d d          Zddi Ze G dj dke$          Zf G dl dmej7                  Zg G dn doejh                  Zi G dp dqeg          Zj ejk        e*du dr           G ds dtej7                              Zldu Zmendvk    r ejo                     dS dS )w    N)array)	ltlegtgeeqnetruedivfloordivmod)support)is_resource_enabled	ALWAYS_EQLARGESTSMALLEST)MINYEARMAXYEAR	timedeltatzinfo)timetimezone)UTC)datedatetimec                 ,    g | ]}t           t           |fS  )pickle).0protos     */usr/lib/python3.11/test/datetimetester.py
<listcomp>r$   /   s5     C C C 65) C C C       
   g     @A@abcr   infnanc                   ,    e Zd Zd Zd Zd Zd Zd ZdS )
TestModulec                     t           }|                     |j        d           |                     |j        d           d S )Nr&   '  )datetime_moduleassertEqualr   r   )selfr   s     r#   test_constantszTestModule.test_constantsB   s?    ")1---)400000r%   c                 P    |                      t          t          j                   d S N)assertIsr   r   utcr1   s    r#   test_utc_aliaszTestModule.test_utc_aliasG   s    c8<(((((r%   c                 z    	 t          t                    }t          j        D ]}|                     ||           d S r4   )dirr/   __all__assertIn)r1   	all_attrsattrs      r#   test_allzTestModule.test_allJ   sE    @((	#+ 	+ 	+DMM$	****	+ 	+r%   c                    d| j         j        v r|                     d           t          }t	          d t          |          D                       }t	          g d          }|                     ||z
  t	          g                      d S )N_Purez"Only run for Fast C implementationc              3   n   K   | ]0}|                     d           |                    d           ,|V  1dS )__N)
startswithendswith)r!   names     r#   	<genexpr>z/TestModule.test_name_cleanup.<locals>.<genexpr>U   sd       N NT??400N9=t9L9LND N N N N N Nr%   )r   r   r   r   datetime_CAPIr   r   r   r   r   sys)	__class____name__skipTestr/   setr:   r0   )r1   r   namesalloweds       r#   test_name_cleanupzTestModule.test_name_cleanupP   s    dn---MM>???" N NS]] N N N N N / / / 0 0 	#b''22222r%   c                    d| j         j        v r|                     d           t          j        }|                      |dd          d           |                      |dd          d           |                      |dd          d	           |                      |d
d          d           |                      |dd          d           |                      |d
d          d	           |                      |dd          d	           |                      |dd          d           |                      |dd          d           |                      |dd          d	           |                      |dd          d	           |                      |dd          d           |                      |dd          d           |                      |dd          d	           d S )N_Fastz'Only run for Pure Python implementation            r'         )rJ   rK   rL   r/   _divide_and_roundr0   )r1   dars     r#   test_divide_and_roundz TestModule.test_divide_and_round\   s   dn---MMCDDD/S"q)))QR((( 	QA&&&RR(((QR(((Ra((( 	RQ'''S!b)))Rb)))S"q)))QA&&&RR(((QR(((Ra(((((r%   N)rK   
__module____qualname__r2   r8   r?   rP   ra   r   r%   r#   r,   r,   @   s_        1 1 1
) ) )+ + +
3 
3 
3) ) ) ) )r%   r,   c                   .    e Zd ZddZd Zd Zd Zd ZdS )	FixedOffset*   c                     t          |t                    rt          |          }t          |t                    rt          |          }|| _        || _        || _        d S Nminutes)
isinstanceintr   _FixedOffset__offset_FixedOffset__name_FixedOffset__dstoffsetr1   offsetrF   	dstoffsets       r#   __init__zFixedOffset.__init__}   sb    fc"" 	/v...Fi%% 	5!)444I$r%   c                 4    | j                                         S r4   )rn   lowerr7   s    r#   __repr__zFixedOffset.__repr__   s    {  """r%   c                     | j         S r4   )rm   r1   dts     r#   	utcoffsetzFixedOffset.utcoffset   
    }r%   c                     | j         S r4   )rn   rx   s     r#   tznamezFixedOffset.tzname   s
    {r%   c                     | j         S r4   )ro   rx   s     r#   dstzFixedOffset.dst   s    r%   Nrf   )rK   rb   rc   rs   rv   rz   r}   r   r   r%   r#   re   re   {   sd        % % % %# # #             r%   re   c                       e Zd ZddZdS )PicklableFixedOffsetNc                 @    t                               | |||           d S r4   )re   rs   rp   s       r#   rs   zPicklableFixedOffset.__init__   s"    T64;;;;;r%   )NNNrK   rb   rc   rs   r   r%   r#   r   r      s(        < < < < < <r%   r   c                       e Zd ZdZdS )PicklableFixedOffsetWithSlots)rm   rn   spamN)rK   rb   rc   	__slots__r   r%   r#   r   r      s        DIIIr%   r   c                       e Zd Zd ZdS )_TZInfoc                 (    t          j                     S r4   )random)r1   r/   s     r#   rz   z_TZInfo.utcoffset   s    }r%   NrK   rb   rc   rz   r   r%   r#   r   r      s#            r%   r   c                   8    e Zd Zd Zd Zd Zd Zd Zd Zd Z	dS )	
TestTZInfoc           
          t                      }t          ddddddd|          }|                     t                    5  |                                 d d d            d S # 1 swxY w Y   d S )N  rX             rU   r   )r   r   assertRaises	TypeErrorrz   )r1   tz1dt1s      r#   test_refcnt_crash_bug_22044z&TestTZInfo.test_refcnt_crash_bug_22044   s    iitQBAq#66y)) 	 	MMOOO	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   A!!A%(A%c                     t                      }t          j        }|                     t          |j        |           |                     t          |j        |           |                     t          |j        |           d S r4   )r   r   maxr   NotImplementedErrorr}   rz   r   )r1   uselessry   s      r#   test_non_abstractnessz TestTZInfo.test_non_abstractness   sl     ((\-w~rBBB-w/@"EEE-w{B?????r%   c                     G d dt                     }|                     t          |t                                 |dd          }|                     |t                      t	          j                    }|                     t          |j        |           |                     t          |j	        |           |                     t          |j
        |           d S )Nc                       e Zd Zd ZdS )9TestTZInfo.test_subclass_must_override.<locals>.NotEnoughc                 "    || _         || _        d S r4   )_NotEnough__offset_NotEnough__name)r1   rq   rF   s      r#   rs   zBTestTZInfo.test_subclass_must_override.<locals>.NotEnough.__init__   s     &"r%   Nr   r   r%   r#   	NotEnoughr      s#        # # # # #r%   r   rU   NotByALongShot)r   
assertTrue
issubclassassertIsInstancer   nowr   r   r}   rz   r   )r1   r   r	   ry   s       r#   test_subclass_must_overridez&TestTZInfo.test_subclass_must_override   s    	# 	# 	# 	# 	# 	# 	# 	# 	
9f55666Yq*++b&)))\^^-ry"===-r|R@@@-rvr:::::r%   c                    t          dd          }|                     |t                     t          j                    d fD ]}|                     |                    |          t          d                     |                     |                    |          d           |                     |	                    |          t          d                     d S )NrU   Threeri   rf   )
re   r   r   r   r   r0   rz   r   r}   r   )r1   fory   s      r#   test_normalzTestTZInfo.test_normal   s    G$$b&))),..$& 	@ 	@BR\\"--y/C/C/CDDDRYYr]]G444RVVBZZ2)>)>)>????	@ 	@r%   c                 J   t          j        t                     }|                     t          |          t                      t          D ]Y\  }}}|                    ||          }|                    |          }|                     t          |          t                      Zd S r4   )r   __new__r5   typepickle_choicesdumpsloads)r1   origpickler	unpicklerr"   greenderiveds          r#   test_pickling_basezTestTZInfo.test_pickling_base   s     ~f%%d4jj&))))7 	1 	1%GYMM$..Eooe,,GMM$w--0000	1 	1r%   c                    t          d          }t          |dfft          |dfft          |fft          |dfffD ]\  }} || }|                    d           }|                     |t                     |                     t          |          |           | 	                    |
                    d           |           | 	                    |                    d           |           t          D ]\  }}}|                    ||          }	|                    |	          }
|                     |
t                     |                     t          |
          |           | 	                    |

                    d           |           | 	                    |
                    d           |           |                     t          |
d                     d S )Nri   cookieESTr   )r   r   r   r   r}   r   r   r5   r   r0   rz   r   r   r   assertFalsehasattr)r1   rq   otypeargsr   onamer   r   r"   r   r   s              r#   test_pickling_subclassz!TestTZInfo.test_pickling_subclass   s   4(((!FH#56*VX,>?y!'	) 	; 	;KE4
 5$<DKK%%E!!$///MM$t**e,,,T^^D116:::T[[..666-; ; ;)EdE22#//%00%%gv666d7mmU333  !2!24!8!8&AAA  !5!5u===  &!9!9::::;	; 	;r%   c                    t          d          x G fddt                    } |            }t          ddddd|	          }|                    |          }|                     ||                                z
  |           d S )
Nr&   hoursc                   ,    e Zd Z	 fdZ fdZd ZdS )0TestTZInfo.test_issue23600.<locals>.UKSummerTimec                     S r4   r   )r1   ry   	DSTOFFSETs     r#   rz   z:TestTZInfo.test_issue23600.<locals>.UKSummerTime.utcoffset   s	      r%   c                     S r4   r   )r1   ry   DSTDIFFs     r#   r   z4TestTZInfo.test_issue23600.<locals>.UKSummerTime.dst   s    r%   c                     dS )NUKSummerTimer   rx   s     r#   r}   z7TestTZInfo.test_issue23600.<locals>.UKSummerTime.tzname   s    %~r%   NrK   rb   rc   rz   r   r}   )r   r   s   r#   r   r      s[        ! ! ! ! !    & & & & &r%   r   r   r[         r   )r   r   r   fromutcr0   rz   )r1   r   tzutr   r   s        @@r#   test_issue23600zTestTZInfo.test_issue23600   s    'a0000)	& 	& 	& 	& 	& 	& 	& 	&6 	& 	& 	& \^^T1b"a333JJqMMQ[[]]*A.....r%   N)
rK   rb   rc   r   r   r   r   r   r   r   r   r%   r#   r   r      s          @ @ @; ; ;@ @ @	1 	1 	1; ; ;./ / / / /r%   r   c                   t    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd ZdS )TestTimeZonec                     t          t          d          d          | _        t          t          d           d          | _        t	          ddd          | _        d S )N      #@r   ACDTrV   r     r&   )r   r   r   r   r   DTr7   s    r#   setUpzTestTimeZone.setUp   sT    YS1116::	YQ////774A&&r%   c                     | j         | j        t          j        t          j        t          j        fD ]8}|                     t          |          |                    d                      9d S r4   )	r   r   r   r6   minr   r0   strr}   r1   r   s     r#   test_strzTestTimeZone.test_str  s\    9dh</ 	7 	7BSWWbiioo6666	7 	7r%   c                     t           }| j        | j        t          j        t          j        t          j        fD ]4}t          |          }|                     |t          |                     5d S r4   )
r/   r   r   r   r6   r   r   reprr0   eval)r1   r   r   tzreps       r#   	test_reprzTestTimeZone.test_repr  sd    "9dh</ 	. 	.B HHERe----		. 	.r%   c                 f   t          dd          }|                     t          j                            d           t
                     |                     t          j                            d           |            |                     t          j                            d           |           d S )N   ;   r   rj   )r   r0   r   r6   rz   ZEROr   r   )r1   limits     r#   test_class_memberszTestTimeZone.test_class_members  s    B/////55t<<<//55v>>>//55u=====r%   c                    |                      t          j        t          t          d                               |                     t          j        t          t          d          d                     |                     t          j        t          t          d          d                     t          d          t          d          fD ]K}t          |          }|                     |                    d           t          d          z  d           Lt          dd          t          d          fD ]E}|                     t          t          |           |                     t          t          |            F|                     t                    5  t          d            d d d            n# 1 swxY w Y   |                     t                    5  t          d           d d d            n# 1 swxY w Y   |                     t                    5  t          t          d            d d d            n# 1 swxY w Y   |                     t                    5  t          t          d           d d d            n# 1 swxY w Y   |                     t                    5  t          t          dd	           d d d            d S # 1 swxY w Y   d S )
Nr   r   r&   microsecondssecondsri   rf   ABCextra)r5   r   r6   r   assertIsNotr0   assertNotEqualrz   r   
ValueErrorr   r   )r1   	subminuter   invalids       r#   test_constructorzTestTimeZone.test_constructor  s   hlHYq\\$:$:;;;x	!e'D'DEEEx	!e'D'DEEE#333Yq5I5I5IJ 	N 	NI)$$BT 2 2Yq5I5I5I I1MMMM!!Q16 	> 	>Gj(G<<<j(WH====y))998D>>>999999999999999y))778B<<<777777777777777y))??8D$+?+?+????????????????y))==8D"+=+=+================y))II8D%+I+I+IIIIIIIIIIIIIIIIIIIsZ   F88F<?F<G99G= G=I  II%JJJ,KKKc                     |                      t          j        t                     |                      | j        t                     d S r4   )r   r   r6   r   r   r7   s    r#   test_inheritancezTestTimeZone.test_inheritance'  s8    hlF333dh/////r%   c                 @   | j         }dD ]z}|t          z  }|                     |t          |                              |                     |                     | t          |                               |                     {|                     t                    5  | j                            d           d d d            n# 1 swxY w Y   |                     t                    5  | j                            d           d d d            d S # 1 swxY w Y   d S )N)r   g      ?r    rV   )r   HOURr0   r   rz   r   r   r   )r1   dummyhrq   s       r#   test_utcoffsetzTestTimeZone.test_utcoffset+  sC    	J 	JAXFVXf%5%5%?%?%F%FGGGfWhw&7&7&A&A%&H&HIIIIy))AA48+=+=b+A+A+AAAAAAAAAAAAAAAAy))@@48+=+=a+@+@+@@@@@@@@@@@@@@@@@@@s$   CC
C
+DDDc                    |                      t          j                            | j                             |                     t                    5  | j                            d           d d d            n# 1 swxY w Y   |                     t                    5  | j                            d           d d d            d S # 1 swxY w Y   d S )Nr  rV   )assertIsNoner   r6   r   r   r   r   r   r7   s    r#   test_dstzTestTimeZone.test_dst6  s    (,**4733444y));;48<<+;+;+;;;;;;;;;;;;;;;;y))::48<<???::::::::::::::::::s$   A99A= A=CC
C
c           
         |                      dt          j                            d                      |                      dt	          j        d                      |                      dt          t
                                        d                      |                      dt          dt          z                                d                      |                      dt          dt          z                                d                      |                      dt          t          d                                        d                      |                      d	t          dt          z  d	                              d                      |                      d
t          t
          d
                              d                      |                      dt          t          dd                                        d                      |                      dt          t          dd                                         d                      |                      dt          t          ddd                                        d                      |                      dt          t          ddd                                         d                      |                     t                    5  | j
                            d           d d d            n# 1 swxY w Y   |                     t                    5  | j
                            d           d d d            d S # 1 swxY w Y   d S )Nr   z	UTC-05:00z	UTC+09:30r   z	UTC-00:01ri   XYZ   zUTC+01:06:40r     zUTC-01:06:40zUTC+01:06:40.000001r&   zUTC-01:06:40.000001r  rV   )r0   r   r6   r}   r   r   r  r   r   r   r   r7   s    r#   test_tznamezTestTimeZone.test_tzname<  s,    3 3D 9 9:::
4 0 0111 5 5d ; ;<<<hrDy&9&9&@&@&F&FGGGhsTz&:&:&A&A$&G&GHHHhy/D/D/D&E&E&L&LT&R&RSSSdE : : A A$ G GHHH8D(#;#;#B#B4#H#HIII 	)At2D2D)E)E)L)LT)R)RSSS!9Q#5#5"566==dCC	E 	E 	E.!)AtQ"7"788??EE	G 	G 	G.!9Qa#8#8"899@@FF	H 	H 	H y))>>48??2+>+>+>>>>>>>>>>>>>>>>y))==48??1+=+=+===================s$    L''L+.L+M44M8;M8c                    |                      t                    5  t          j                            | j                   d d d            n# 1 swxY w Y   |                      t                    5  t          j                            d           d d d            n# 1 swxY w Y   | j        | j        t          fD ]}| j        
                    |          }|                    |          }|                     ||z
  |                    |                     |                     || j        
                    t          j                             d S )Nznot datetimer   )r   r   r   r6   r   r   r   r   r   Easternreplacer0   rz   )r1   r   utctimelocals       r#   test_fromutczTestTimeZone.test_fromutcS  s   z** 	* 	*L  )))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*y)) 	1 	1L  000	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	18TY0 	C 	CBgooRo00GJJw''EUW_bll5.A.ABBBU!W__HL_AAC C C C		C 	Cs#   %AAA1 BB!$B!c                    |                      t          t                    t          t                               |                     t          t                    t          t                               |                     t          dt          z            t          dt          z  d                     |                     t                    5  t          t                    t          t                    k      d d d            n# 1 swxY w Y   |                     t          t                    t          t                    h           |                     t          t                    d k               | 	                    t          t                    d k               t          t                    }|                     |t          k               | 	                    |t          k               |                     |t          k                | 	                    |t          k               |                     |t          k               | 	                    |t          k               | 	                    |t          k                |                     |t          k               | 	                    |t          k               |                     |t          k               d S )Nr  r   )r   r   r   r  r0   r   r   r<   r   r   r   r   r   r   s     r#   test_comparisonzTestTimeZone.test_comparison_  s)   HTNNHTNN;;;$$888"t),,hrDy%.H.HIIIy))JJ8D>>HTNN+J+JJJJJJJJJJJJJJJJhtnnx~~&6777$.///$4/000d^^i(((y)))W%%%g&&&g&&&w'''h'''X&&&x(((h'''''s   +DDDc                 N   t          ddd          }t          j        t          j        t          j        fD ]}|                     |                    |          |                    |                                                     |                     |                    |          |                    |                                                     |                     |	                    |          |                    |          	                                           d S )Nr&   r   )
r   r   r   r   r6   r0   r}   r  rz   r   r1   r   r   s      r#   test_aware_datetimez TestTimeZone.test_aware_datetimet  s   Q1<x|< 	9 	9BRYYq\\YYbY1188::< < <R\\!__YYbY11;;==? ? ?RVVAYYYYbY1155779 9 9 9	9 	9r%   c                    | j         | j        t          j        t          j        fD ]O}t
          D ]E\  }}}|                    |                    ||                    }|                     ||           FPt          j	        }t
          D ]E\  }}}|                    |                    ||                    }| 
                    ||           Fd S r4   )r   r   r   r   r   r   r   r   r0   r6   r5   )r1   r   r   r   r"   tz_copys         r#   test_picklezTestTimeZone.test_pickle  s    )TXx|X\A 	. 	.B-; . .)E#//'--E*B*BCC  "----. \)7 	' 	'%GYoogmmB&>&>??GMM'2&&&&	' 	'r%   c                    | j         | j        t          j        t          j        fD ],}t          j        |          }|                     ||           -t          j        }t          j        |          }|                     ||           d S r4   )	r   r   r   r   r   copyr0   r6   r5   r1   r   r  s      r#   	test_copyzTestTimeZone.test_copy  sv    )TXx|X\A 	* 	*BimmGWb))))\)B--gr"""""r%   c                    | j         | j        t          j        t          j        fD ],}t          j        |          }|                     ||           -t          j        }t          j        |          }| 	                    ||           d S r4   )
r   r   r   r   r   r   deepcopyr0   r6   r5   r!  s      r#   test_deepcopyzTestTimeZone.test_deepcopy  sz    )TXx|X\A 	* 	*BmB''GWb))))\-##gr"""""r%   c                    t          dd          t          ddd          t          dddd          g}|                    d |D                        |D ]@}|                     d|	          5  t          |           d d d            n# 1 swxY w Y   At          d
          t          d
d          g}|                    d |D                        |D ]r}|                     d|	          5  |                     t
                    5  t          |           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   sd S )Nr   r   r   r   rj   r   ?B r   rj   r   r   c                     g | ]}| S r   r   r!   deltas     r#   r$   z7TestTimeZone.test_offset_boundaries.<locals>.<listcomp>  s    <<<uUF<<<r%   good)	test_typer,     r   r&   )r   r   c                     g | ]}| S r   r   r+  s     r#   r$   z7TestTimeZone.test_offset_boundaries.<locals>.<listcomp>  s    DDD5DDDr%   bad)r   extendsubTestr   r   r   )r1   time_deltasr,  bad_time_deltass       r#   test_offset_boundariesz#TestTimeZone.test_offset_boundaries  s1    B+++BB777BBVLLL

 	<<<<<===  	  	 Ee<<                                 
 BBQ///
 	DDODDDEEE$ 	$ 	$EU;; $ $&&z22 $ $UOOO$ $ $ $ $ $ $ $ $ $ $ $ $ $ $$ $ $ $ $ $ $ $ $ $ $ $ $ $ $	$ 	$sH   0BB	B	3ED*E*D..E1D.2EE	E	c                     |                      t          j        t                                 |                      t          t	          d                    t                                 d S )Nr&   r   )r   r   r6   r   r   r7   s    r#   test_comparison_with_tzinfoz(TestTimeZone.test_comparison_with_tzinfo  sS     	HL&((333HYQ%7%7%788&((CCCCCr%   N)rK   rb   rc   r   r   r   r   r   r   r  r	  r  r  r  r  r  r"  r%  r6  r8  r   r%   r#   r   r      s!       ' ' '
7 7 7
. . .> > >J J J$0 0 0A A A; ; ;> > >.
C 
C 
C( ( (*	9 	9 	9' ' '# # ## # #$ $ $2D D D D Dr%   r   c                       e Zd Zd Zd ZdS )HarmlessMixedComparisonc                    |                      ddd          }|                     |dk               |                     |dk               |                     d|k               |                     d|k               |                     |ddg |g           |                     g |ddg g           |                     |t          k               |                     |t          k               |                     |t
          k                |                     |t
          k               |                     |t
          k               |                     |t
          k               |                     |t          k                |                     |t          k               |                     |t          k               |                     |t          k               d S )Nr&   r      )theclassr   r   r<   r   r   r   r1   mes     r#   test_harmless_mixed_comparisonz6HarmlessMixedComparison.test_harmless_mixed_comparison  s   ]]1a##r"""b!!!r"""b!!!b1b"b/***b2q"b/*** 	i(((y))) 	W%%%g&&&g&&&w'''h'''X&&&x(((h'''''r%   c                    |                      ddd          |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd	           d S )
Nr&   c                       dk     S Nr   r   r?  s   r#   <lambda>zGHarmlessMixedComparison.test_harmful_mixed_comparison.<locals>.<lambda>      R"W r%   c                       dk    S rC  r   rD  s   r#   rE  zGHarmlessMixedComparison.test_harmful_mixed_comparison.<locals>.<lambda>      R2X r%   c                       dk    S rC  r   rD  s   r#   rE  zGHarmlessMixedComparison.test_harmful_mixed_comparison.<locals>.<lambda>  rF  r%   c                       dk    S rC  r   rD  s   r#   rE  zGHarmlessMixedComparison.test_harmful_mixed_comparison.<locals>.<lambda>  rH  r%   c                      d k     S rC  r   rD  s   r#   rE  zGHarmlessMixedComparison.test_harmful_mixed_comparison.<locals>.<lambda>  rF  r%   c                      d k    S rC  r   rD  s   r#   rE  zGHarmlessMixedComparison.test_harmful_mixed_comparison.<locals>.<lambda>  rH  r%   c                      d k    S rC  r   rD  s   r#   rE  zGHarmlessMixedComparison.test_harmful_mixed_comparison.<locals>.<lambda>  rF  r%   c                      d k    S rC  r   rD  s   r#   rE  zGHarmlessMixedComparison.test_harmful_mixed_comparison.<locals>.<lambda>  rH  r%   )r=  r   r   r>  s    @r#   test_harmful_mixed_comparisonz5HarmlessMixedComparison.test_harmful_mixed_comparison  s   ]]1a##)____555)%5%5%5%5666)____555)%5%5%5%5666)____555)%5%5%5%5666)____555)%5%5%5%566666r%   N)rK   rb   rc   r@  rO  r   r%   r#   r:  r:    s2        ( ( (:7 7 7 7 7r%   r:  c                       e Zd ZeZd Zd Zd Zej	        d             Z
d Zd Zd Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zej	        d             Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!dS )TestTimeDeltac                 *   | j         }t          } | |             |ddddddd                      | |d           |d                      | |dd           |d                      | |ddd           |d                      | |d           |d                      | |d           |d	
                      | |d
           |d                      | |d           |d                      | |d           |d                      | |d           |d                      | |d           |d                      | |d           |d
                      | |d
           |d                      | |d           |d                      | |d           |d                      | |d           |d                     d S )Nr   )weeksdaysr   rj   r   millisecondsr   r&   rT  r   r   rS  rX   r/  r   <   ri     rU  g$I$I?gUUUUUU?g?gMbP?)r0   r   )r1   r   tds      r#   r   zTestTimeDelta.test_constructor  s    	2244!!1a!"4 4 4 	5 	5 	5
22a55""!***
22a88RR]]]###
22aA;;***+++
22A;;;


###
221:::rr|||$$$
22A;;;2'''
22a===""R...)))
22a===""$///000
221rrt444555 	22E???BBAJJJ'''
226???BBQKKK(((
22FRR]]]+++
22frr!}}}---
22ebba000111
225!!!221#5#5#566666r%   c                    | j         }t          } |d          } |dd          } |ddd          } |||z   |z    |ddd                      |||z
   |dd                      ||                    |           |dd                      ||  |d                      ||
  |d                      ||  |dd                      ||  |dd	d
                      |t          |          |            |t          |           |            | |dd          |            | |ddd          |            ||dz   |d                      ||dz  d|z              ||dz  d|z              ||dz   |dd                      |d|z   |dd                      ||dz   |dd                      ||dz   |ddd                      |d|z   |ddd                      ||dz   |ddd                      ||dz  |             ||dz  | |z
              ||dz  | | z               ||dz  |dz  dz              ||dz  d|z  dz              ||dz   |dd                      |d|z   |dd                      ||dz   |d                      ||dz   |dd                      ||dz   |ddd                      ||dz   |dd                      ||dz   |ddd                      ||dz   |d                      ||dz   |dd                      ||dz   |d                      ||dz   |dd                      ||dz   |ddd                      ||dz   |dd                      ||dz   |ddd                      |d          } |d|z  dz  d|z              |d|z  dz  d|z              |dd|z  z  d|z              |dd|z  z  d|z              |d|z  dz  d|z              |d |z  dz  d|z              | |d!          d"z   |d#                      | |d!          d$z   |d%                      |d|z  dz  d|z              |d|z  dz  d|z              |d|z  d&z  d|z              |d |z  d&z  d|z              |d|z  dz  d|z              |d|z  dz  d|z              |d|z  d'z  d|z              |d|z  d'z  d|z             t	          d(d          D ]'} |||z  dz  |z  t          |dz                       (t	          d(d          D ]'} |||z  dz  |z  t          |dz                       ( | |d!          d)z   |d%                      | |d*d	d+           |d*d	d,          z
   |ddd                      | |d*dd           |d*dd          z
   |ddd                     d S )-NrX   r   rX  rY  r]   iDQ rZ   r  Q X> Q i r'   F   iX  '  rW     r/  r&   i@  i6 i@       ?   x   r   rU   rY   rV   rT   r  r   翶~Ϛ?@ g6+1?iS	 g       @g       rS   g`""K?-?ɚ;r(  >B )r0   r   __rsub__absrangeround)r1   r   r[  abcusis           r#   test_computationszTestTimeDelta.test_computations  sC   BqEEBq"IIBq!TNN
1Q3q5""QD//"""
1Q31l##$$$
1::a==""Q--...
A2rr"vv
A2rr!uu
A2rr"l##$$$
A2rr"k6**+++
3q661
3r77A
22a>>1
22aJ###
1R4B
1R4A
1R4A
1R4As
2a4As
1R4As
1R4Aq%!!!
2a4Aq%!!!
1R4Aq%!!!
1R4!
1R4!A
1R4!QB
1e9qtRi   
1e9r!tRi   
1T622a88
4622a88
1a4A
1b5""Q((
1d7BBq!QKK   
1b5""Q//"""
1g:rr!Q	**+++
1S5""R&&
1S5""Q**
1Q31
1R4Aq
1T622aA;;
1R4Ax!!!
1W9bbAy))*** RQ
AbDC<2
AbDC<2
3!B$<2
3!B$<2
BrES="R%   
BrES="R%    	22a===8#RRV%<%<%<===
22a===9$bbf&=&=&=>>> 	AbDA:qt
AbDA:qt
BrES="R%   
BrES="R%   
AbDB;2
AbDB;2
AbDD="R%   
AbDD="R%   sB 	) 	)AB"Q|U1Q3ZZ((((sB 	+ 	+AB"R"}eAbDkk**** 	22a===M*BBF,C,C,CDDD 	22i''""Yv*F*FF2aA;;	 	 	
22iAIq!!4!442aA;;	 	 	 	 	r%   c                 b   t          d          dD ]~|                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           d|                     t          fd           |                     t          fd	           |                     t          fd
           |                     t          fd           |                     t          fd           d S )Nrf   r&         ?c                       z   S r4   r   rn  rr  s   r#   rE  z<TestTimeDelta.test_disallowed_computations.<locals>.<lambda>d      1 r%   c                       z
  S r4   r   rx  s   r#   rE  z<TestTimeDelta.test_disallowed_computations.<locals>.<lambda>e  ry  r%   c                       z   S r4   r   rx  s   r#   rE  z<TestTimeDelta.test_disallowed_computations.<locals>.<lambda>f  ry  r%   c                       z
  S r4   r   rx  s   r#   rE  z<TestTimeDelta.test_disallowed_computations.<locals>.<lambda>g  ry  r%   r   c                       z  S r4   r   rn  zeros   r#   rE  z<TestTimeDelta.test_disallowed_computations.<locals>.<lambda>l  s    TQY r%   c                       z  S r4   r   r~  s   r#   rE  z<TestTimeDelta.test_disallowed_computations.<locals>.<lambda>m  s    Q$Y r%   c                       z  S r4   r   r~  s   r#   rE  z<TestTimeDelta.test_disallowed_computations.<locals>.<lambda>n  s    QX r%   c                       dz  S )N        r   rn  s   r#   rE  z<TestTimeDelta.test_disallowed_computations.<locals>.<lambda>o  s    QW r%   c                       dz  S )Nr  r   r  s   r#   rE  z<TestTimeDelta.test_disallowed_computations.<locals>.<lambda>p  s    QV r%   )r   r   r   ZeroDivisionError)r1   rn  rr  r  s    @@@r#   test_disallowed_computationsz*TestTimeDelta.test_disallowed_computations_  sM   bMM  	6 	6Ai555i555i555i5555 )%6%6%6%6%6777+->->->->->???+-=-=-=-=-=>>>+____===)^^^^44444r%   c                     t          d          }|                     t          |j        t                     |                     t          |j        t                     d S )Nrf   )r   r   r   __mul__NAN__truediv__)r1   rn  s     r#   test_disallowed_specialz%TestTimeDelta.test_disallowed_specialr  sG    bMM*ai555*amS99999r%   c                     d\  }}}t          |||          }|                     |j        |           |                     |j        |           |                     |j        |           d S )N)r&   rX      r   r0   rT  r   r   )r1   rT  r   rq  r[  s        r#   test_basic_attributesz#TestTimeDelta.test_basic_attributesx  sm    $grtWb))$'''W---"-----r%   c                    t          d          }|                     |                                d           dD ]:}t          |          }|                     |                                |           ;dD ]K}t          |          }|                     |                                |t          d          z             Ld S )	Nm  rV  g    8~A)g˟$@g˟$rf  r   g    .Ar   )r  rW   ir   r&   )r   r0   total_seconds)r1   r[  r  mss       r#   test_total_secondsz TestTimeDelta.test_total_seconds  s    C   ))++Z888N 	@ 	@M=111BR--//???? ! 	L 	LB+++BR--//i6J6J6J1JKKKK	L 	Lr%   c                 |    t          dddddd          }t          d	          }|                     ||           d S )
Nd   rZ   8rT   r   g   ArT  rS  r   rj   r   r   r&   r   )r   r0   r1   t1t2s      r#   test_carrieszTestTimeDelta.test_carries  sU    C)!!$9; ; ; A&&&R     r%   c                    t          dddddd          }t                      }|                     t          |          t          |                     |t          d	          z  }|t          d
          z  }|                     ||           |                     t          |          t          |                     |di}d||<   |                     t          |          d           |                     ||         d           d S )Nr  rZ   r  rT   r   i z
r  rX   rW  1   rV  r&   rY   )r   r0   hashlen)r1   r  r  ds       r#   test_hash_equalityz TestTimeDelta.test_hash_equality  s   C)!!$9; ; ; [[b488,,,
ia    
iS!!!!R   b488,,,G"Q###2"""""r%   c                     d}t          | }t          D ]G\  }}}|                    ||          }|                    |          }|                     ||           Hd S )N)r   "   8   )r   r   r   r   r0   r1   r   r   r   r   r"   r   r   s           r#   test_picklingzTestTimeDelta.test_pickling  sn    $)7 	, 	,%GYMM$..Eooe,,GT7++++	, 	,r%   c                    t          ddd          t          ddd          }|                     |           |                     |k               |                     |k               |                     |k               |                     |k                |                     |k               dD ]8}t          | }|                     |k                |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k                |                     |k               |                     |k               :t          D ]c|                     k    d           |                     k    d           |                     k    d           |                     k    d           |                     t          fd           |                     t          fd           |                     t          fd	           |                     t          fd
           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           ed S )NrY   rU   r[   )rU   rU   rU   )rY   r[   r[   )rY   rU   rV   FTc                       k    S r4   r   badargr  s   r#   rE  z,TestTimeDelta.test_compare.<locals>.<lambda>      v r%   c                       k     S r4   r   r  s   r#   rE  z,TestTimeDelta.test_compare.<locals>.<lambda>      f r%   c                       k    S r4   r   r  s   r#   rE  z,TestTimeDelta.test_compare.<locals>.<lambda>  r  r%   c                       k    S r4   r   r  s   r#   rE  z,TestTimeDelta.test_compare.<locals>.<lambda>  r  r%   c                       k    S r4   r   r  s   r#   rE  z,TestTimeDelta.test_compare.<locals>.<lambda>      2 r%   c                       k     S r4   r   r  s   r#   rE  z,TestTimeDelta.test_compare.<locals>.<lambda>      " r%   c                       k    S r4   r   r  s   r#   rE  z,TestTimeDelta.test_compare.<locals>.<lambda>  r  r%   c                       k    S r4   r   r  s   r#   rE  z,TestTimeDelta.test_compare.<locals>.<lambda>  r  r%   )r   r0   r   r   
OTHERSTUFFr   r   r1   r  r   r  r  s      @@r#   test_comparezTestTimeDelta.test_compare  s|   q!Qq!QR   b!!!b!!!r"""b!!!b!!!3 	' 	'DD!BOOBG$$$OOBG$$$OOB"H%%%OOB"H%%%OOB"H%%%OOB"H%%%R2X&&&R2X&&&R"W%%%R"W%%%R2X&&&R2X&&&&  	? 	?FR6\5111R6\4000Vr\5111Vr\4000i)=)=)=)=)=>>>i)<)<)<)<)<===i)<)<)<)<)<===i)=)=)=)=)=>>>i)=)=)=)=)=>>>i)<)<)<)<)<===i)<)<)<)<)<===i)=)=)=)=)=>>>>	? 	?r%   c                    t           }| j        } |t           |d                    d            |t           |d                    d            |t           |d                    d            |t           |d                    d            |t           |d	d
d                    d            |t           |ddd                    d            |t           |ddd	d                    d            |t           |d                    d            |t           |d                    d            |t           |ddddd                    d           d S )Nr&   z1 day, 0:00:00r  z-1 day, 0:00:00rY   z2 days, 0:00:00rW   z-2 days, 0:00:00r   :   r   r'  z12:58:59rU   r[   z2:03:04ir   r  )rS  r   rj   r   z-210 days, 23:12:34rZ  z0:00:00.001000r   z0:00:00.000003rh  r(  rT  r   rj   r   r   z999999999 days, 23:59:59.999999)r   r0   r   )r1   r[  r   s      r#   r   zTestTimeDelta.test_str  s   
3rr!uu::'(((
3rr"vv;;)***
3rr!uu::()))
3rr"vv;;*+++
3rrB33344jAAA
3rr1a000119===
3rr2r2>>>?? 	" 	" 	" 	3rrq!!!""$4555
3rrq!!!""$4555
3rryB &( ( ( ) ),	. 	. 	. 	. 	.r%   c           	         d| j         j        z   }|                     t          |                      d                    d|z             |                     t          |                      dd                    d|z             |                     t          |                      ddd                    d	|z             |                     t          |                      d
                    d|z             |                     t          |                                            d|z             |                     t          |                      d                    d|z             |                     t          |                      dd                    d|z             |                     t          |                      dd                    d|z             d S )N	datetime.r&   z
%s(days=1)r'   rY   z%s(days=10, seconds=2)rS    z,%s(days=-10, seconds=2, microseconds=400000)rX  r   z%s(seconds=60)z%s(0)r  r   z%s(microseconds=100))rT  r   z%s(days=1, microseconds=100))r   r   z%s(seconds=1, microseconds=100)r=  rK   r0   r   r1   rF   s     r#   r   zTestTimeDelta.test_repr  s   T]33dmmA..//%,	. 	. 	.dmmB22331D8	: 	: 	:dmmCF;;<<G$N	P 	P 	PdmmBm7788)D0	2 	2 	2dmmoo.. 4	) 	) 	)dmmm==>>/$6	8 	8 	8dmmmEEFF7$>	@ 	@ 	@dmmACmHHII:TA	C 	C 	C 	C 	Cr%   c                    t          ddddd          t          d          t          dd	          t          dd
d          fD ]}t          |          }|                     |                    d                     |dd          }t	          |          }|                     ||           t          |j        |j        |j                  }|                     ||           d S )Nrh  r   r   r(  r  6erV  r&   rT  r   rY   rU   rT  r   r   r  	   )	r   r   r   rD   r   r0   rT  r   r   )r1   r[  std2s       r#   test_roundtripzTestTimeDelta.test_roundtrip  s    )2r%'f> > >*---*a888!QQ???	A 	& 	&B RAOOALL55666!""Aq''CR%%% BGRZAACR%%%%	& 	&r%   c                 T   |                      t          j        t                     |                      t          j        t                     |                      t          j        t                     |                     t          j        t          j        k               |                     t          j        t          d                     |                     t          j        t          ddd                     |                     t          j        t          ddd                     d S )Nr  rh  r]  g    ~.Ar   r&   )r   r   r   r   
resolutionr   r0   r7   s    r#   test_resolution_infoz"TestTimeDelta.test_resolution_info  s    imY777imY777i2I>>>		5666	*(=(=>>>	)Y(N(NOOO-yAq/A/ABBBBBr%   c                    t           j        }t           j        |z   }||z  }|                     t          |j        |           |                     t          |j        |            t           j        |z
  }||z  }|                     t          |j        |           |                     t          |j        |            |                     t          d            t          d          }|                     t          |j        d           |                     t          |j        d           |                     t          |j	        d           |                     t          |j	        d           |                     t          |j	        d           d S )Nc                      t           j         S r4   )r   r   r   r%   r#   rE  z-TestTimeDelta.test_overflow.<locals>.<lambda>)  s
    )- r%   r&    ʚ;g    eAg#B;g|=gr{>)
r   r  r   r   OverflowError__sub____add__r   r  r  )r1   tinyr[  days       r#   test_overflowzTestTimeDelta.test_overflow  sM   #]T!
d
-T:::-dU;;;]T!
d
-T:::-dU;;;-)?)?@@@ll-e<<<-c:::-%@@@-%@@@-%@@@@@r%   c                     t          d          }|                     t          |j        t                     |                     t          |j        t                      d S Nr&   )r   r   r  r  INF)r1   r  s     r#   _test_overflow_specialz$TestTimeDelta._test_overflow_special2  sI    ll-c:::-sd;;;;;r%   c                 z   t           }| j        } | |d           |d                      | |d           |d                      | |d           |d                      | |d           |d                      | |d           |d	                      | |d
           |d                      | |d           |d                      | |d           |d                      | |d           |d                      | |d           |d                      | |d           |d                      | |d           |d                     d}|dz  } | |d|z             |d                      | |d|z             |d                      | |d|z  d|z             |d	                      | |d|z             |d                      | |d|z             |d                      | |d|z  d|z             |d                      | |d           d  |d!          z              | |d           |j        z  d |j        z  |j        z             d S )"Ng-C6:?rZ  r   g-C6:gMb@?r   gMb@ga2U0*C?r&   ga2U0*Cr  g~jtX?rY   g~jtXrW   gƠ>r   gƠ      ?        i|   tAr/  g?rV  g?r   rT  r   gٿgɿrc  rv  )r   r0   r  )r1   r[  r   us_per_hour
us_per_days        r#   test_microsecond_roundingz'TestTimeDelta.test_microsecond_rounding8  s    	228$$$bbee,,,
229%%%rr!uu---
228$$$bba&8&8&8999
229%%%rrr':':':;;;
228$$$bba&8&8&8999
229%%%rrr':':':;;;
228$$$bba&8&8&8999
229%%%rrr':':':;;;
22i   ""!"4"4"4555
22j!!!222#6#6#6777
22frrt444555
22g 6 6 6777  2%

222j=!!!22a55)))
22B{N###RRUU+++
222j=;7779K9K9KLLL
223z>"""BBqEE***
22CO$$$bbee,,,
223z>[999222;N;N;NOOO 	223RRS%9%9%9!9:::
223.BM0A2=0PQQQQQr%   c                 v    t          d          }|                     |j        |j        |j        fd           d S )Nr  r   )r  r]  r(  r  )r1   r[  s     r#   test_massive_normalizationz(TestTimeDelta.test_massive_normalizationY  sF    B'''"'2:r?0	2 	2 	2 	2 	2r%   c                 b   |                      t          d                     |                      t          dd                     |                      t          ddd                     |                      t          d                     |                     t          d                     d S )Nr&   r   r   )r   r   r   r7   s    r#   	test_boolzTestTimeDelta.test_bool^  s    	!%%%	!Q(((	!Q**+++	q1112221&&&&&r%   c                     G fddt                      d          }|                     t          |                     |                     |                                d            dd          }|                     t          |                     |                     |                                d	           ||z   }|                     t          |          t                                          |          }|                     t          |                     |                     |j        |j                   |                     |j        |j                   |                     |j        |j                   |                     t          |          t          |                     |                     |                                d           d S )
Nc                   0    e Zd Ze fd            Zd ZdS )0TestTimeDelta.test_subclass_timedelta.<locals>.Tc                 <     | j         | j        | j                  S r4   r  )r[  Ts    r#   from_tdz8TestTimeDelta.test_subclass_timedelta.<locals>.T.from_tdh  s    q"*bo>>>r%   c                 `    | j         dz  | j        dz  z   | j        dz  z   }t          |          S )Nr/  g      @r  )rT  r   r   rm  )r1   sums     r#   as_hoursz9TestTimeDelta.test_subclass_timedelta.<locals>.T.as_hoursl  s:    y2~|f,-(612 Szz!r%   N)rK   rb   rc   staticmethodr  r  )r  s   r#   r  r  g  sG        ? ? ? ? \?" " " " "r%   r  r&   rV  r/  r  ir  i)
r   r5   r   r0   r  r  rT  r   r   r   )r1   r  r  t3t4r  s        @r#   test_subclass_timedeltaz%TestTimeDelta.test_subclass_timedeltae  s   		" 		" 		" 		" 		" 		" 		"	 		" 		" 		" QAYYYd2hh"""+++QB&&&d2hh""",,,"Wd2hh	***YYr]]d2hh""""'***RZ000"/:::R#b''***+++++r%   c           	          G d dt                     } |ddd          }t          d          }dd  |ddd	          fd
d  |ddd	          fdd  |ddd          fg}|D ]k\  }}}|                     |          5   |||          }|                     ||           |                     ||           d d d            n# 1 swxY w Y   ld S )Nc                       e Zd ZdS )6TestTimeDelta.test_subclass_date.<locals>.DateSubclassNrK   rb   rc   r   r%   r#   DateSubclassr            Dr%   r    r&   rV   rV  addc                     | |z   S r4   r   r  r   s     r#   rE  z2TestTimeDelta.test_subclass_date.<locals>.<lambda>  
    Q r%   r]   raddc                     || z   S r4   r   r  s     r#   rE  z2TestTimeDelta.test_subclass_date.<locals>.<lambda>  
    !a% r%   subc                     | |z
  S r4   r   r  s     r#   rE  z2TestTimeDelta.test_subclass_date.<locals>.<lambda>  r   r%   r[   )r   r   r3  r0   r   )	r1   r  d1r[  testsrF   funcexpectedacts	            r#   test_subclass_datez TestTimeDelta.test_subclass_date  ss   	 	 	 	 	4 	 	 	 \$1%%A &&T1a(@(@A''dAq)A)AB&&T1a(@(@A
 %* 	9 	9 D$d## 9 9d2rll  h///%%c<8889 9 9 9 9 9 9 9 9 9 9 9 9 9 9	9 	9s    9CC		C		c           
          G d dt                     } |ddddd          }t          dd          }d	d
  |dddd          fdd  |dddd          fdd  |dddd          fg}|D ]k\  }}}|                     |          5   |||          }|                     ||           |                     ||           d d d            n# 1 swxY w Y   ld S )Nc                       e Zd ZdS )>TestTimeDelta.test_subclass_datetime.<locals>.DateTimeSubclassNr  r   r%   r#   DateTimeSubclassr    r  r%   r  r  r&   rV   r      )rT  rj   r  c                     | |z   S r4   r   r  s     r#   rE  z6TestTimeDelta.test_subclass_datetime.<locals>.<lambda>  r   r%   r]      r  c                     || z   S r4   r   r  s     r#   rE  z6TestTimeDelta.test_subclass_datetime.<locals>.<lambda>  r  r%   r  c                     | |z
  S r4   r   r  s     r#   rE  z6TestTimeDelta.test_subclass_datetime.<locals>.<lambda>  r   r%   r[   )r   r   r3  r0   r   )	r1   r  r  r[  r  rF   r  r	  r
  s	            r#   test_subclass_datetimez$TestTimeDelta.test_subclass_datetime  s   	 	 	 	 	x 	 	 	 dAq"b11Ar*** &&(8(8q!R(H(HI'')9)9$1b)I)IJ&&(8(8q!R(H(HI
 %* 	= 	= D$d## = =d2rll  h///%%c+;<<<= = = = = = = = = = = = = = =	= 	=s   9CC	C	c                    t          ddd          }t          d          }|                     ||z  d           |                     ||z  d           t          dd	
          }t          d          }|                     ||z  d           |                     ||z  d           t          d          }|                     t          t          ||           |                     t          t
          ||           d S )Nr&   r/     r'  r   g     ó@i  rY   r  rj   r   ri   g      @r   )r   r0   r   r  r
   r   )r1   r   secondminutezerotds        r#   test_divisionzTestTimeDelta.test_division  s    Ar26661%%%VV,,,fd+++a,,,1%%%VS)))fa(((1+Wa@@@+Xq&AAAAAr%   c                    t          dd          }t          d          }||z  }|                     |t          d                     t          dd          }||z  }|                     |t          d                     t          d          }|                     t          t          ||           |                     t
          t          |d	           d S 
NrY   r  r  r&   ri   r   rW   r   r'   )r   r0   r   r  r   r   )r1   r   r  rr  s        r#   test_remainderzTestTimeDelta.test_remainder  s    a,,,1%%%JIb111222b"---KIb1112221+S!V<<<)S!R00000r%   c                 D   t          dd          }t          d          }t          ||          \  }}|                     |d           |                     |t          d                     t          dd          }t          ||          \  }}|                     |d           |                     |t          d                     t          d          }|                     t          t          ||           |                     t
          t          |d	           d S r  )r   divmodr0   r   r  r   )r1   r   r  qr  r  s         r#   test_divmodzTestTimeDelta.test_divmod  s   a,,,1%%%a  1AIb111222b"---a  1BIb1112221+VQ???)VQ33333r%   c                    d }|                      t                    5  t                       |ddz            z   d d d            n# 1 swxY w Y   |                      t                    5  t                       |ddz            z   d d d            n# 1 swxY w Y   dD ]}|                      t                    5  t                       ||          z   d d d            n# 1 swxY w Y   |                      t                    5  t                       ||          z   d d d            n# 1 swxY w Y   d S )Nc                 B      G  fddt                     } |            S )Nc                       e Zd Z fdZdS )FTestTimeDelta.test_issue31293.<locals>.get_bad_float.<locals>.BadFloatc                     S r4   r   )r1   	bad_ratios    r#   as_integer_ratiozWTestTimeDelta.test_issue31293.<locals>.get_bad_float.<locals>.BadFloat.as_integer_ratio  s	    $$r%   N)rK   rb   rc   r+  )r*  s   r#   BadFloatr(    s.        % % % % % % %r%   r,  )float)r*  r,  s   ` r#   get_bad_floatz4TestTimeDelta.test_issue31293.<locals>.get_bad_float  sE    % % % % % % %5 % % % 8::r%   r&   rY  )r   r   r&   rY   rU   )r   r   r   r   )r1   r.  r*  s      r#   test_issue31293zTestTimeDelta.test_issue31293  s?   	 	 	 y)) 	3 	3KK--T	2222	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3y)) 	3 	3KK--T	2222	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 1 	7 	7I"":.. 7 7mmI66667 7 7 7 7 7 7 7 7 7 7 7 7 7 7"":.. 7 7mmI66667 7 7 7 7 7 7 7 7 7 7 7 7 7 7	7 	7sG   AAA-BBB C''C+	.C+	D33D7	:D7	c                     G fddt                     } G fdd           G fddt                     dD ]G|                               5  	 t           |d	          
           n# t          $ r Y nw xY w	 t           |d	                     n# t          $ r Y nw xY w	 t           |d	                     n# t          t          f$ r Y nw xY w	 t          d	           |d	          z   n# t          t          f$ r Y nw xY w	  |d	          t          d	          z   n# t          $ r Y nw xY w	 t          d	           |d	          z   n# t          $ r Y nw xY wd d d            n# 1 swxY w Y   Id S )Nc                   8    e Zd Z fdZ fdZ fdZ fdZdS )-TestTimeDelta.test_issue31752.<locals>.BadIntc                                  S r4   r   r1   otherProds     r#   r  z5TestTimeDelta.test_issue31752.<locals>.BadInt.__mul__      tvvr%   c                                  S r4   r   r5  s     r#   __rmul__z6TestTimeDelta.test_issue31752.<locals>.BadInt.__rmul__  r8  r%   c                                  S r4   r   r5  s     r#   __floordiv__z:TestTimeDelta.test_issue31752.<locals>.BadInt.__floordiv__  r8  r%   c                                  S r4   r   r5  s     r#   __rfloordiv__z;TestTimeDelta.test_issue31752.<locals>.BadInt.__rfloordiv__  r8  r%   N)rK   rb   rc   r  r:  r<  r>  )r7  s   r#   BadIntr3    sy                          r%   r?  c                   $    e Zd Z fdZ fdZdS )+TestTimeDelta.test_issue31752.<locals>.Prodc                                  S r4   r   r1   r6  Sums     r#   r  z3TestTimeDelta.test_issue31752.<locals>.Prod.__add__      suur%   c                                  S r4   r   rC  s     r#   __radd__z4TestTimeDelta.test_issue31752.<locals>.Prod.__radd__  rE  r%   N)rK   rb   rc   r  rG  )rD  s   r#   r7  rA    sG                  r%   r7  c                       e Zd Z fdZdS )*TestTimeDelta.test_issue31752.<locals>.Sumc                     S r4   r   )r1   r6  divmodresults     r#   
__divmod__z5TestTimeDelta.test_issue31752.<locals>.Sum.__divmod__  s	    ##r%   N)rK   rb   rc   rL  rK  s   r#   rD  rI    s.        $ $ $ $ $ $ $r%   rD  )Nr   )r   r&   rY   )r   r  rM  r&   r   r   rW  )rl   r3  r   r   r   )r1   r?  r7  rD  rK  s     @@@r#   test_issue31752zTestTimeDelta.test_issue31752  s   	 	 	 	 	 	 	S 	 	 		 	 	 	 	 	 	 	 	 		$ 	$ 	$ 	$ 	$ 	$ 	$# 	$ 	$ 	$ ; 	 	L<88  66!9955555    DFF1II.....    DFF1II.....!:.   DaLL66!99,,,!:.   DF1II	!,,,    DaLLFF1II---    D1              	 	s   E;A43E;4
B>E; BE;BE;
B,)E;+B,,E;0C
	E;
CE;CE;"C>=E;>DE;DE;D21E;2
D?<E;>D??E;EE;
E,)E;+E,,E;;E?	E?	N)"rK   rb   rc   r   r=  r   rs  r  r   requires_IEEE_754r  r  r  r  r  r  r  r   r   r  r  r  r  r  r  r  r  r  r  r  r   r$  r0  rN  r   r%   r#   rQ  rQ    s       H7 7 72Q Q Qf5 5 5& : : :
. . .
L 
L 
L! ! !# # #(, , ,&? &? &?P. . .*C C C&& & &$C C CA A A, < < <
R R RB2 2 2
' ' ', , ,>9 9 9&= = =&B B B&1 1 14 4 4"7 7 7(1 1 1 1 1r%   rQ  c                       e Zd Zd ZdS )TestDateOnlyc                    t          ddd          }t          ddddd          }t          |j                  }|                     |t          d                     ||z   }|                     |||z              ||z   }|                     |||z              ||z
  }|                     |||z
             | }t          |j                  }|                     |t          d                     ||z   }|                     |||z              ||z   }|                     |||z              ||z
  }|                     |||z
             d S )	N  r&   rY   rU   r[   rV   r  rW   )r   r   rT  r0   )r1   ry   r,  rT  dt2s        r#   test_delta_non_days_ignoredz(TestDateOnly.test_delta_non_days_ignored,  sg   $1q1a'(* * *$$y||,,,5jb4i(((bjb4i(((5jb4i((($$y}}---5jb4i(((bjb4i(((5jb4i(((((r%   N)rK   rb   rc   rU  r   r%   r#   rQ  rQ  (  s#        ) ) ) ) )r%   rQ  c                       e Zd ZdZdS )SubclassDater&   NrK   rb   rc   sub_varr   r%   r#   rW  rW  I          GGGr%   rW  c                      e Zd ZeZd Zd Zd Zd Zd Z	d Z
d Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"d Z#d  Z$d! Z%d" Z&d# Z'd$ Z(d% Z)d& Z*d' Z+d( Z,d) Z-d* Z.d+ Z/d,S )-TestDatec                     |                      ddd          }|                     |j        d           |                     |j        d           |                     |j        d           d S )N  rU   r&   )r=  r0   yearmonthr  rx   s     r#   r  zTestDate.test_basic_attributesR  se    ]]4A&&$'''1%%%#####r%   c                    |                      ddd          | j                                         fD ]}t          |          }|                     |                    d                     |dd          }t          |          }|                     ||           |                      |j        |j        |j	                  }|                     ||           d S )Nr&   rY   rU   r  r  )
r=  todayr   r   rD   r   r0   r_  r`  r  r1   ry   r  rT  s       r#   r  zTestDate.test_roundtripX  s    ==Aq))=&&((* 	& 	&B RAOOALL55666!""Aq''CR%%% --26::CR%%%%	& 	&r%   c           	         dD ]\  }}}}|                      |||          }|                     ||                                           | j                             |          }|                     ||           t	          |d          rl|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           t          t          t          dz   d          D ]}|                      |dd          }|                                }| j                             |          }|                     ||           |dk    rx| j                             |dz
            }|                      |dz
  dd          }|                     ||           |                     |                                |dz
             g d}d	D ]\  }}	|                      |dd                                          }t          t          dd
          |          D ]\  }
}|
dk    r|	r|dz  }t          d|dz             D ]t}|                      ||
|          }|                     |                                |           |                     || j                             |                     |dz  }ud S )N))r&   r&   r&   r&   )r&   r   r  r  )rY   r&   r&   n  )i  r   r   i
 hourr   r&   rX   r   r  )r     r  r  r  r  r  r  r  r  r  r  ))rS  T)r^  Fr  rY   )r=  r0   	toordinalfromordinalr   rf  r  r  microsecondrl  r   r   zip)r1   ymr  nfromordr_  d2dimisleapr`  maxdayr  s                r#   test_ordinal_conversionsz!TestDate.test_ordinal_conversionsf  s   3 	9 	9JAq!Q
 aA&&AQ...m//22GQ(((w'' 9   q111  333  333  !4a888 '719a00 	6 	6DdAq))AA**1--BQ###axxM--ac22]]462r22  B'''  1555 ?>>7 		 		LD&dAq))3355A!$U1b\\3!7!7  vA::&:aKF F1H--  CdE377A$$Q[[]]A666$$Q(A(A!(D(DEEEFAA			 		r%   c                    | j         j        |                      j        j        j                                                                                }|                     |           |                     t          fd           t          d          z   }|                     |                                dz              |                     || j                             dz                        | j         j        |                      j        j        j                                                                                }|                     |           |                     t          fd           t          d          z
  }|                     |                                dz
             |                     || j                             dz
                       d S )Nc                  4                          dz
            S r  ri  rn  aords   r#   rE  z0TestDate.test_extreme_ordinals.<locals>.<lambda>      ammD1H.E.E r%   r&   rV  c                  4                          dz             S r  rw  rx  s   r#   rE  z0TestDate.test_extreme_ordinals.<locals>.<lambda>  rz  r%   )r=  r   r_  r`  r  rh  ri  r0   r   r   r   r   )r1   ro  rn  ry  s     @@r#   test_extreme_ordinalszTestDate.test_extreme_ordinals  s   MMM!&!'1511{{}}MM$A*&E&E&E&E&EFFF	q!!!!q111DM55dQh??@@@MMM!&!'1511{{}}MM$A*&E&E&E&E&EFFF	q!!!!q111DM55dQh??@@@@@r%   c                 8   |                      t          dd           |                      t          dd           |                     t          | j         t          dz
  dd           |                     t          | j         t          dz   dd           |                      ddd           |                      ddd           |                     t          | j         ddd           |                     t          | j         ddd           |                      ddd           |                      ddd           |                      d	dd           |                     t          | j         ddd
           |                     t          | j         ddd           |                     t          | j         ddd           |                     t          | j         ddd           |                     t          | j         ddd           |                     t          | j         ddd           d S )Nr&   rS  r   r   r  rY        `	  r    4  l  r   )r=  r   r   r   r   r7   s    r#   test_bad_constructor_argumentsz'TestDate.test_bad_constructor_arguments  s   gq!$$$gq!$$$*dmWQY1EEE*dmWQY1EEEdAq!!!dB"""*dmT1a@@@*dmT2qAAAdAr"""dAr"""dAr"""*dmT1bAAA*dmT1bAAA*dmT1bAAA*dmT1bAAA*dmT1a@@@*dmT1bAAAAAr%   c                 f   |                      ddd          }|                      ddd          }|                     ||           |                     t          |          t          |                     |di}d||<   |                     t          |          d           |                     ||         d           |                     ||         d           |                      ddd          }|                      ddd          }|                     ||           |                     t          |          t          |                     |di}d||<   |                     t          |          d           |                     ||         d           |                     ||         d           d S )NrS  r   r  r&   rY   r  r=  r0   r  r  r1   r  edics       r#   r  zTestDate.test_hash_equality  s   MM$B''MM$B''Aa$q''***!fAS1%%%Q###Q###MM$Q''MM$Q''Aa$q''***!fAS1%%%Q###Q#####r%   c                 	   |                      ddd          |                      ddd          }|                      ddd          }|z
  }|                     |j        dt          t	          ddd                    z              |                     |j        d	           |                     |j        d	           t          d          t          d
          }|                      ddd          |                     z   |                      ddd                     |                     z   |                      ddd                     |                     z
  |                      ddd                     |                      z   |                      ddd                     |                     |z   |                      ddd                     |                     |z
  |                      ddd                     |                     d|z  z   |                      ddd                     |                     d|z  z
  |                      ddd                     |                     |z   z
  |           |                     z   z
             |                     |z
  z
  |            |                     z
  z
              |                     |z   z
  |            |                     z   z
              |                     |z
  z
  |           |                     z
  z
             |                     ||z
  z
             dD ]~|                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           d S )Nr^  r&   r    r  rY   A  r[   r   rX   rU   r  r   4     ru  c                       z   S r4   r   rx  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>  ry  r%   c                       z
  S r4   r   rx  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>  ry  r%   c                       z   S r4   r   rx  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>   ry  r%   c                       z
  S r4   r   rx  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>  ry  r%   c                       z
  S r4   r   rn  r  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>      S1W r%   c                       z  S r4   r   r  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>  r  r%   c                       z  S r4   r   r  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>      QW r%   c                       z  S r4   r   r  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>      SAX r%   c                       z  S r4   r   r  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>	      Q#X r%   c                        z  S r4   r   r  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>
      QU r%   c                        z  S r4   r   r  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>      Q!V r%   c                        z   S r4   r   r  s   r#   rE  z,TestDate.test_computations.<locals>.<lambda>  r  r%   
r=  r0   rT  r  rl  r   r   r   r   r   )r1   ro  rp  diffweekrn  r  rr  s        @@@r#   rs  zTestDate.test_computations  s   MM$2&&MM$2&&MM$q##sFStT11E1E-F-F$FGGGq)))*A...ll||MM$1%%S$--a";";<<<q$--a";";<<<S$--a";";<<<#4==q!#<#<===T4==q!#<#<===T4==q"#=#=>>>RWdmmD!Q&?&?@@@RWdmmD!Q&?&?@@@!d(a...!c'Q,,,!d(a$///!c'Q---a$h$///a#g---a$h...a#g,,,a#g,,,  	6 	6Ai555i555i555i5555 	)_____555)_____555)_____555)%5%5%5%5%5666)%5%5%5%5%5666)]]]]333)^^^^444)]]]]33333r%   c                    | j         j        }|t          d          t          d          fD ]}| j         j        |z   }||z  }|                     t
          |j        |           |                     t
          |j        |            | j         j        |z
  }||z  }|                     t
          |j        |           |                     t
          |j        |            d S )Nr&   rY   )	r=  r  r   r   r   r  r  r  r   )r1   r  r,  ry   s       r#   r  zTestDate.test_overflow  s    }'IaLL)A,,7 		A 		AE"U*B%KBmRZ???mRZ%@@@"U*B%KBmRZ???mRZ%@@@@		A 		Ar%   c                 "   dd l }d\  }}} |j        |||ddddddf	          }| j                            |          }|                     |j        |           |                     |j        |           |                     |j        |           d S )Nr   )i  r  r  r  )r   mktimer=  fromtimestampr0   r_  r`  r  )r1   r   r_  r`  r  tsr  s          r#   test_fromtimestampzTestDate.test_fromtimestamp  s     'eST[$sAq!Q2>??M''++&&&%((($$$$$r%   c                 \    dD ](}|                      t          | j        j        |           )d S N)gZbtgZbtir   r  r=  r  r1   insanes     r#   test_insane_fromtimestampz"TestDate.test_insane_fromtimestamp(  F    
 $ 	& 	&FmT]-H$& & & &	& 	&r%   c                 B   dd l }t          d          D ]\}| j                                        } |j                     }| j                            |          }||k    r n |j        d           ]||k    r(|                     ||t          d                     d S d S )Nr   rU   g?rc  r   )r,  )r   rl  r=  rb  r  sleepassertAlmostEqualr   )r1   r   r  rb  r  
todayagains         r#   
test_todayzTestDate.test_today1  s     1XX 	 	EM''))EB44R88J
"" DJsOOOO J"":u)23)?)?)? # A A A A A r%   c           	      :   t          d          D ]	}|                     |                     ddd|z                                             |           |                     |                     ddd|z                                             |dz              |                     |                     ddd|z                                             |           |                     |                     ddd|z                                             |dz              d S )NrX   r^  rU   r[   r&   r  rY   )rl  r0   r=  weekday
isoweekday)r1   rr  s     r#   test_weekdayzTestDate.test_weekdayN  s   q 	L 	LAT]]4AaC88@@BBAFFFT]]4AaC88CCEEqsKKKT]]4AaC88@@BBAFFFT]]4AaC88CCEEqsKKKK	L 	Lr%   c                 n   g d}g }|D ]a\  }} | j         | }t          d          D ]B}|t          |          z   }|dd         |d         |z   fz   }|                    ||f           Cb|D ]\  }	}
|                     |	d          5  |                     |	                                |
           d d d            n# 1 swxY w Y   |                     |	d          5  |	                                }|                     |j        |j        |j	        f|
           d d d            n# 1 swxY w Y   d S )N)))r  r      )r  r  r&   ))r  r   r~  r  r&   r&   ))r  r&   rV   )r  rY   r&   ))  r   r   )r  r  r&   ))r  r   rg  )r  5   r&   ))r   r&   r[   )r   r&   r&   rX   r   rY   tuple)r  
comparisonfields)
r=  rl  r   appendr3  r0   isocalendarr_  r  r  )r1   week_mondays
test_casescal_dateiso_date	base_daterr  new_datenew_isor  exp_isor   s               r#   test_isocalendarzTestDate.test_isocalendarW  s   
 
 
 
". 	7 	7Hh%x0I1XX 7 7$y||3"1Q3-8A;?*<<!!8W"566667
 % 	G 	GJAwg66 ; ;  ':::; ; ; ; ; ; ; ; ; ; ; ; ; ; ; h77 G GMMOO  !&!&!)!<gFFFG G G G G G G G G G G G G G G	G 	Gs$   	)B>>C	C	 =D))D-	0D-	c                 &   	 |                      ddd          }t          j        |                                          }t          j        |          }|                     t          |          t                     |                     |d           d S )N  r&   )r  r&   rY   )r=  r    r   r  r   r0   r   r  )r1   r  press       r#   test_isocalendar_picklingz"TestDate.test_isocalendar_picklingu  sz    	 MM$1%%L))l1oocE***l+++++r%   c                 (   d}t          t          t          |                                                    }g }t	          d          D ]}|                     d|z   dd          }|                     d|z   dd          }|                     |                                dd          |                                dd                     |                                d         dk    r|                    |           |                     ||           d S )	NaK  
              4   32   60   88
              9   37   65   93
             15   43   71   99
             20   48   76
             26   54   82

            105  133  161  189
            111  139  167  195
            116  144  172
            122  150  178
            128  156  184

            201  229  257  285
            207  235  263  291
            212  240  268  296
            218  246  274
            224  252  280

            303  331  359  387
            308  336  364  392
            314  342  370  398
            320  348  376
            325  353  381
          rS  r   r  i@  r&   r  )	sortedmaprl   splitrl  r=  r0   r  r  )r1   ISO_LONG_YEARS_TABLEiso_long_yearsLrr  r  r  s          r#   test_iso_long_yearszTestDate.test_iso_long_years  s     2  C)=)C)C)E)E F FGGs 	 	Ad1fb"--AtAvr2..BQ]]__QRR0"..2B2B1222FGGG}}q!R''N+++++r%   c                     |                      ddd          }|                     |                                d           d S )NrY   rU   z
0002-03-02)r=  r0   	isoformatr1   r   s     r#   test_isoformatzTestDate.test_isoformat  s;    MM!Q""55555r%   c                     |                      ddd          }|                     |                                d           d S )Nr^  rU   rY   zSat Mar  2 00:00:00 2002)r=  r0   ctimer  s     r#   
test_ctimezTestDate.test_ctime  s<    MM$1%%$>?????r%   c                 b   |                      ddd          }|                     |                    d          d           |                     |                    d          d           |                     |                    d          d           |                     t          |j                   |                     t          |j        dd	           |                     t          |j        d
           |                     |                    d          d           |                     |                    d          d           dD ](}	 |                    |           # t
          $ r Y %w xY w	 |                    d           n# t          $ r Y nw xY w|                    d           d S )N  rU   rY   m:%m d:%d y:%yzm:03 d:02 y:05r    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxonetworf   %m03	'%z' '%Z''' '')z%e%z%#u   %y%mz%f)r=  r0   strftimer   r   r   UnicodeEncodeError)r1   r   fs      r#   test_strftimezTestDate.test_strftime  s   MM$1%%$4557GHHHB,,,H--x888)QZ000)QZ>>>)QZ444 	D))4000 	K00'::: # 	 	A

1   	JJ|$$$$! 	 	 	D	 	


4s$   E##
E0/E04F
 

FFc                    |                      ddd          }	 t          j        d           n%# t          $ r |                     d           Y nw xY w|                     |                    d          t          j        d|                                                     |                     |                    d          t          j        d|                                                     d S )Nr  rU   rY   r  z'time module does not support trailing %zm:%m d:%d y:%y %zm:03 d:02 y:05 %)r=  _timer  r   rL   r0   	timetupler  s     r#   test_strftime_trailing_percentz'TestDate.test_strftime_trailing_percent  s    
 MM$1%%	EN3 	E 	E 	EMMCDDDDD	EC%.akkmm*L*LMMMJJ)**N-q{{}}==	
 	
 	
 	
 	
s   . AAc                    |                      ddd          }|                     |                    d          t          |                     |                     t
          d          5  |                    d           d d d            n# 1 swxY w Y    G d d| j                   } |ddd          }|                     |                    d          d            G d	 d
| j                   } |ddd          }|                     |                    d          t          |                     dD ]}|                     |                    |          |                    |                     |                     |                    |          |                    |                     |                     |                    |          d
           d S )N  r  r'   r  must be str, not int{   c                       e Zd Zd ZdS )TestDate.test_format.<locals>.Ac                     dS NAr   r7   s    r#   __str__z'TestDate.test_format.<locals>.A.__str__      sr%   NrK   rb   rc   r  r   r%   r#   r  r    #            r%   r  c                       e Zd Zd ZdS )TestDate.test_format.<locals>.Bc                     dS NBr   r1   format_specs     r#   r  z(TestDate.test_format.<locals>.B.strftime  r   r%   NrK   rb   rc   r  r   r%   r#   r  r    r  r%   r  r  zm:%m d:%d y:%y H:%H M:%M S:%S%z %Zr=  r0   
__format__r   assertRaisesRegexr   r  r1   ry   r  rn  r  ro  fmts          r#   test_formatzTestDate.test_format  s#   ]]4B''r**CGG444##I/EFF 	 	MM#	 	 	 	 	 	 	 	 	 	 	 	 	 	 		 	 	 	 	 	 	 	 AdArNNb))3///	 	 	 	 	 	 	 	 AdArNNb))3r77333 	5 	5C R]]3//S1A1ABBBQ\\#..C0@0@AAAQ\\#..4444	5 	5s   )BBBc                 |   t          | j        t                    rt          }nt          }|                     | j        j        |           |                     | j        j        |           |                     | j        j        t                     | 	                    | j        j        | j        j        k               d S r4   )
r   r=  r   r   r   r   r   r  r   r   )r1   expected_classs     r#   r  zTestDate.test_resolution_info  s    dmX.. 	"%NN!Ndm/@@@dm/@@@dm6	BBB)DM,==>>>>>r%   c                 z   | j         j        | j         j        z
  }|j        dz  dz  |j        z   dz  |j        z   }t          dd|          }|                     ||           |                     | j         j        |z   | j         j                   |                     | j         j        |z
  | j         j                   d S )Nr/    @B r   )r=  r   r   rT  r   r   r   r0   )r1   bigrn  	justasbigs       r#   test_extreme_timedeltazTestDate.test_extreme_timedelta  s    m$-"33Xb[+W4s7GGaA&&	i(((*S0$-2CDDD*S0$-2CDDDDDr%   c                 6   t          d          D ]}|                     ddd|z             }|                                }|                     |ddd|z   ddd|d|z   df	           |                     ddd|z             }|                                }|                     |ddd|z   dddd|z   dz  d|z   df	           |                     ddd|z             }|                                }|                     |ddd|z   dddd|z   dz  d	|z   df	           |                     |j        d           |                     |j        d           |                     |j        d|z              |                     |j        d           |                     |j        d           |                     |j	        d           |                     |j
        d|z   dz             |                     |j        d	|z              |                     |j        d           	d S )
NrX   r  r&   rY   r   r  r   rU   =   )rl  r=  r  r0   tm_yeartm_montm_mdaytm_hourtm_mintm_sectm_wdaytm_ydaytm_isdst)r1   rr  r  r   s       r#   test_timetuplezTestDate.test_timetuple  s#   q 	- 	-AdAqs++AAQq!A#q!Q1Q3 CDDDdAqs++AAQq!A#q!Q1aAr JKKK dAqs++AAQq!A#q!Q1aAr JKKKQY---QXq)))QY!,,,QY***QXq)))QXq)))QY1a000QY1---QZ,,,,-	- 	-r%   c                 2   d} | j         | }t          D ]G\  }}}|                    ||          }|                    |          }|                     ||           H|                     |                                |                    d                     d S )Nr]   rX   r   rY   r=  r   r   r   r0   
__reduce____reduce_ex__r  s           r#   r  zTestDate.test_pickling0  s    t}d#)7 	, 	,%GYMM$..Eooe,,GT7++++**D,>,>q,A,ABBBBBr%   c                     g d}d} | j         | }|D ]/}t          D ]%} ||d          }|                     ||           &0d S )N)s'   cdatetime
date
(S'\x07\xdf\x0b\x1b'
tR.s   cdatetime
date
(UtR.s   cdatetime
date
UR.)  r      latin1encodingr=  pickle_loadsr0   r1   r  r   r	  datar   r   s          r#   test_compat_unpicklezTestDate.test_compat_unpickle9  s    
 
 

  4=$' 	4 	4D% 4 4%x888  (33334	4 	4r%   c                    |                      ddd          |                      ddd          }|                     |           |                     |k               |                     |k               |                     |k               |                     |k                |                     |k               dD ]9} | j         | }|                     |k                |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k                |                     |k               |                     |k               ;t          D ]D|                     k    d           |                     k    d           |                     k    d           |                     k    d           |                     t          fd           |                     t          fd           |                     t          fd	           |                     t          fd
           |                     t          fd           |                     t          fd           |                     t          fd           Fd S )NrY   rU   r[   r  FTc                       k     S r4   r   r  s   r#   rE  z'TestDate.test_compare.<locals>.<lambda>e  r  r%   c                       k    S r4   r   r  s   r#   rE  z'TestDate.test_compare.<locals>.<lambda>f  r  r%   c                       k    S r4   r   r  s   r#   rE  z'TestDate.test_compare.<locals>.<lambda>g  r  r%   c                       k    S r4   r   r  s   r#   rE  z'TestDate.test_compare.<locals>.<lambda>h  r  r%   c                       k     S r4   r   r  s   r#   rE  z'TestDate.test_compare.<locals>.<lambda>i  r  r%   c                       k    S r4   r   r  s   r#   rE  z'TestDate.test_compare.<locals>.<lambda>j  r  r%   c                       k    S r4   r   r  s   r#   rE  z'TestDate.test_compare.<locals>.<lambda>k  r  r%   )r=  r0   r   r   r  r   r   r  s      @@r#   r  zTestDate.test_compareF  se   ]]1a##]]1a##R   b!!!b!!!r"""b!!!b!!!3 	' 	'D%BOOBG$$$OOBG$$$OOB"H%%%OOB"H%%%OOB"H%%%OOB"H%%%R2X&&&R2X&&&R"W%%%R"W%%%R2X&&&R2X&&&&  	? 	?FR6\5111R6\4000Vr\5111Vr\4000i)<)<)<)<)<===i)<)<)<)<)<===i)=)=)=)=)=>>>i)=)=)=)=)=>>>i)<)<)<)<)<===i)<)<)<)<)<===i)=)=)=)=)=>>>>	? 	?r%   c                    |                      ddd          |                     dk    d           |                     dk    d           |                     dk    d           |                     dk    d           |                     t          fd           |                     t          fd            G d	 d
          } |            |                     k    d           |                     k    d           |                     k    d           |                     k    d           |                     t          fd           |                     t          fd           d S )NrS  r[   rV   r&   FTc                       dk     S r  r   ours   r#   rE  z-TestDate.test_mixed_compare.<locals>.<lambda>w  s    S1W r%   c                      d k     S r  r   rA  s   r#   rE  z-TestDate.test_mixed_compare.<locals>.<lambda>x  s    QW r%   c                       e Zd ZdS ).TestDate.test_mixed_compare.<locals>.SomeClassNr  r   r%   r#   	SomeClassrE  |  r  r%   rF  c                       k     S r4   r   rB  theirs   r#   rE  z-TestDate.test_mixed_compare.<locals>.<lambda>  s    S5[ r%   c                       k     S r4   r   rH  s   r#   rE  z-TestDate.test_mixed_compare.<locals>.<lambda>  s    US[ r%   )r=  r0   r   r   )r1   rF  rB  rI  s     @@r#   test_mixed_comparezTestDate.test_mixed_comparem  s   mmD!Q'' 	5)))c5)))4(((c4((( 	)____555)____555	 	 	 	 	 	 	 	 	u---#u---t,,,#t,,,)%8%8%8%8%8999)%8%8%8%8%899999r%   c                     |                      | j        j                   |                      | j        j                   d S r4   )r   r=  r   r   r7   s    r#   r  zTestDate.test_bool  s6    )***)*****r%   c                 >   dD ]}|                      |dd          }|                    d          d|z  k    rd|                     |                    d          d|z             t          j        r,|                     |                    d          d|z             d S )N)r&   r  r`  c   r  i  rY    r&   z%Yz%04d%dz%4Y)r=  r  r0   r   has_strftime_extensions)r1   rl  r  s      r#   test_strftime_y2kzTestDate.test_strftime_y2k  s    6 	D 	DAaA&&A
 zz$6A:--  D!1!14!8<<<2 D$$QZZ%6%6
CCC	D 	Dr%   c                 d   | j         }g d} || }|                     ||                                           d}dD ]C\  }}|d d          }|||<    || } |j        d
i ||i}	|                     ||	           |dz  }D |ddd          }|                     t          |j        d	           d S )Nr/  r   )r_  rY   r`  rU   r  r[   r&   rS  rY   r~  r  r_  r   r=  r0   r  r   r   
r1   clsr   baserr  rF   newvalnewargsr	  gots
             r#   test_replacezTestDate.test_replace  s    myysDzt||~~...) 	 	LD& 111gGGAJsG}H$,00$00CXs+++FAA s4B*dl>>>>>r%   c                      G d d| j                   } |ddd          }|                     t          |                    d                    |           d S )Nc                       e Zd ZdS )4TestDate.test_subclass_replace.<locals>.DateSubclassNr  r   r%   r#   r  rb    r  r%   r    r&   i  rW  r=  r5   r   r  )r1   r  ry   s      r#   test_subclass_replacezTestDate.test_subclass_replace  ss    	 	 	 	 	4= 	 	 	 \$1%%d2::4:0011<@@@@@r%   c                      G  fdd j                   }d}  j         | } ||i ddi}                     |j        |                                |j        d                                |j        d                                |                                |                                                                |                    d          |j        |j        z   dz
             d S )Nc                   $    e Zd ZdZ fdZd ZdS )&TestDate.test_subclass_date.<locals>.Crf   c                     |                                 }|                    d          } j        j        | g|R i |}||_        |S Nr   r   popr=  r   r   rZ  r   kwstempr   resultr1   s         r#   r   z.TestDate.test_subclass_date.<locals>.C.__new__  Q    xxzz))..sBTBBBTBB$r%   c                 &    || j         z   | j        z   S r4   )r_  r`  r1   starts     r#   newmethz.TestDate.test_subclass_date.<locals>.C.newmeth  s    ty(4:55r%   NrK   rb   rc   	theAnswerr   ru  r7   s   r#   Crh    sB        I    6 6 6 6 6r%   rx  r  r[   rd  r   rX   rf   rZ   )	r=  r0   rJ   rw  r   rh  ru  r_  r`  r1   rx  r   r   rT  s   `    r#   r  zTestDate.test_subclass_date  s   	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 dmT"a&'1&&***+++A&&&#--//:::R#(SY*>*BCCCCCr%   c                 |     G  fdd j                   }d}d}d} || }                     ||                                |j        d           t	          j        |t          d                                                    }d|ffd	|ffd
|ffg}|D ]\  }}	||fD ]}
                     t          |
          |          5  t          |
|          } ||	 }                     ||                                ||                                |j        d           d d d            n# 1 swxY w Y   d S )Nc                       e Zd Z fdZdS )CTestDate.test_subclass_alternate_constructors.<locals>.DateSubclassc                 B     j         j        | g|R i |}d|_        |S NrX   r=  r   r   rZ  r   kwargsrp  r1   s       r#   r   zKTestDate.test_subclass_alternate_constructors.<locals>.DateSubclass.__new__  3    ..sDTDDDVDD r%   NrK   rb   rc   r   r7   s   r#   r  r}    .              r%   r  ry  i( z
2003-04-14rX   r   ri  r  fromisoformatbase_obj_typeconstr_name)r=  r   r0   r   r   combiner   	timestampr3  r   getattr)r1   r  r   d_ordd_isoformatbase_dr  r  r  constr_argsbase_objconstrry   s   `            r#   $test_subclass_alternate_constructorsz-TestDate.test_subclass_alternate_constructors  s   	 	 	 	 	 	 	4= 	 	 	 "t$fl333q))) fd1gg..88:: UH%re${n-

 )3 	2 	2$K)62 2 2\\X.9 " ; ; 2 2$X{;;F-B ))"l;;; $$R000 $$RXq1112 2 2 2 2 2 2 2 2 2 2 2 2 2 22	2 	2s   AD//D36D3c                 
   d}t          | }t          D ]o\  }}}|                    ||          }|                    |          }|                     ||           |                     t          |t                                pd S )Nr(  )rW  r   r   r   r0   r   rk   r  s           r#   test_pickling_subclass_datez$TestDate.test_pickling_subclass_date  s    T")7 	? 	?%GYMM$..Eooe,,GT7+++OOJw==>>>>		? 	?r%   c           	      d   d}t          | j        t                    s
|d d         }dD ]9}|                     t          | j        |d d         |z   |dd          z              :t          | j        t                    rg|                     t          d          5  |                     t          dgt          |          z            d           d d d            n# 1 swxY w Y   t          dd	          D ];}|                     |d d         t          |g          z   |dd          z              <d S )
Ns
   1995-03-25r[   )   9          rY   rU   ^bad tzinfo state arg$r&   r   r  )	r   r=  r   r   r   r  bytesr  rl  )r1   r[  
month_byteord_bytes       r#   test_backdoor_resistancez!TestDate.test_backdoor_resistance  s    $-22 	8D5 	K 	KJi)-bqbJ)>abb)IK K K KdmX.. 	=''	3KLL = =eQC#d))O44e<<<= = = = = = = = = = = = = = = a 	C 	CH MM$rr(UH:%6%66abbABBBB		C 	Cs   5CC Cc                 4   g d}|D ]} | j         | }|                                }|                     |          5  | j                             |                                          }|                     ||           d d d            n# 1 swxY w Y   d S )N)r&   r&   r&   )rY  rY   rd  r  r&   r&   )rS  rY   r~  r  r   r   )r  r[   rU   i  rV   r  )dt_strr=  r  r3  r  r0   )r1   
base_datesdt_tuplery   r  dt_rts         r#   test_fromisoformatzTestDate.test_fromisoformat   s    
 
 

 # 	, 	,H)B\\^^FV,, , ,33BLLNNCC  U+++, , , , , , , , , , , , , , ,	, 	,s   ABB	B	c                    d|                      ddd          fd|                      ddd          fd|                      ddd          fd|                      d	d
d          fd|                      ddd          fd|                      ddd          fd|                      ddd          fd|                      d	d
d          fd|                      dd
d          fd|                      dd
d          fd|                      ddd          fd|                      ddd          fd|                      dd
d          fd|                      dd
d          fd|                      dd
d          fd|                      dd
d          fd|                      dd
d          fd|                      dd
d          fd|                      d dd          fd!|                      d dd          fd"|                      d#d
d          fd$|                      d#d
d          fd%|                      d&dd          fd'|                      d(d
d)          fd*|                      d(d
d)          fd+|                      d,dd          fg}|D ]c\  }}|                     |-          5  | j                             |          }|                     ||           d d d            n# 1 swxY w Y   dd S ).N00010101r&   20000101rS  20250102  rY   99991231r.   r   r  z
0001-01-01z
2000-01-01
2025-01-02z
9999-12-312025W01  r  z2025-W012025W014z
2025-W01-42026W01r~  z2026-W012026W013z
2026-W01-32022W52  r   z2022-W522022W527  z
2022-W52-72015W534r-  z
2015-W53-4z
2015-W53-5  2020W531  rg  z
2020-W53-1z
2020-W53-6  	input_str)r=  r3  r  r0   r1   examplesr  r	  actuals        r#    test_fromisoformat_date_examplesz)TestDate.test_fromisoformat_date_examples4  s.   q!Q//0tQ223tQ223tR4454==Aq1124==q!4454==q!4454==r2667dB334tR445tQ2234==q!445dB334tR445tR4454==r2667dB334tR445tQ2234==q!445tR4454==r26674==q!445tR4454==r26674==q!4455
: $, 	3 	3Ix	22 3 344Y??  2223 3 3 3 3 3 3 3 3 3 3 3 3 3 3	3 	3s   1KK	K	c                      G d d| j                   } |ddd          }|                    |                                          }|                     ||           d S )Nc                       e Zd ZdS ):TestDate.test_fromisoformat_subclass.<locals>.DateSubclassNr  r   r%   r#   r  r  X  r  r%   r  r   r   rd  )r=  r  r  r   )r1   r  ry   r  s       r#   test_fromisoformat_subclassz$TestDate.test_fromisoformat_subclassW  sz    	 	 	 	 	4= 	 	 	 \$B''**2<<>>::e\22222r%   c                     g d}|D ]N}|                      t                    5  | j                            |           d d d            n# 1 swxY w Y   Od S )N)r  r  z	009-03-04	123456789z
200a-12-04z
2009-1a-04z
2009-12-0az
2009-01-32z
2009-02-29z
2019-W53-1z
2020-W54-1u   20090228)r   r   r=  r  r1   bad_strsbad_strs      r#   test_fromisoformat_failsz!TestDate.test_fromisoformat_failsa  s    
 
 
   	5 	5G"":.. 5 5++G4445 5 5 5 5 5 5 5 5 5 5 5 5 5 5	5 	5s   A

A	A	c                     dd t          j        d          g}|D ]N}|                     t                    5  | j                            |           d d d            n# 1 swxY w Y   Od S )Ns
   2009-03-01z
2009-03-01ioStringIOr   r   r=  r  r1   	bad_typesbad_types      r#   "test_fromisoformat_fails_typeerrorz+TestDate.test_fromisoformat_fails_typeerrorv  s    "D"+l*C*CD	! 	6 	6H""9-- 6 6++H5556 6 6 6 6 6 6 6 6 6 6 6 6 6 6	6 	6   AA!	$A!	c                 4   ddddddddd	d
dddt           ddft          ddfg}|D ]s}|                     |          5   | j        | }|                                } | j        j        | }|                     ||           d d d            n# 1 swxY w Y   td S )N)r  r[   rU   )r  r&   rY   )i  r   r  )r   r&   rY   )r  r   r  r  )r  r   r  )rS  r&   r&   )rS  r   r  r  )r  r   r  r  )r.   r   r  r&   r   r  )	datecomps)r   r   r3  r=  r  fromisocalendarr0   )r1   datesr  dobjisocald_roundtrips         r#   test_fromisocalendarzTestDate.test_fromisocalendar}  s    aOb"
$  	4 	4I	22 4 4$t}i0))++;dm;VD  {3334 4 4 4 4 4 4 4 4 4 4 4 4 4 4	4 	4s   ABB	B	c                     g d}|D ]q}|                      |          5  |                     t                    5   | j        j        |  d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   rd S )N))r  r   r&   )r  r  r&   )r  6   r&   )r  r&   r   )r  r&   r  )r  r&      )r  r  r&   )ra  r&   r&   )r   r&   r&   )i r&   r&   )        r&   r&   )r  r  r&   )r  r&   r  r  )r3  r   r   r=  r  )r1   isocalsr  s      r#   !test_fromisocalendar_value_errorsz*TestDate.test_fromisocalendar_value_errors  s   
 
 
   	; 	;FV,, ; ;&&z22 ; ;1DM16::; ; ; ; ; ; ; ; ; ; ; ; ; ; ;; ; ; ; ; ; ; ; ; ; ; ; ; ; ;	; 	;s4   A-A
A-AA-AA--A1	4A1	c                    t           t          d g}g }d}t          d          D ]L}|D ]G}t          |          } |||                   ||<   |                    t          |                     HM|D ]q}|                     |          5  |                     t                    5   | j	        j
        |  d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   rd S )Nc                     d S r4   r   )xs    r#   rE  z;TestDate.test_fromisocalendar_type_errors.<locals>.<lambda>  s    d r%   )r  r&   r&   rU   r  )r   r-  rl  listr  r  r3  r   r   r=  r  )r1   err_txformersr  r[  rr  txformererr_valr  s           r#    test_fromisocalendar_type_errorsz)TestDate.test_fromisocalendar_type_errors  s   N
 q 	/ 	/A) / /t**%Xgaj11
uW~~..../
  	; 	;FV,, ; ;&&y11 ; ;1DM16::; ; ; ; ; ; ; ; ; ; ; ; ; ; ;; ; ; ; ; ; ; ; ; ; ; ; ; ; ;	; 	;s6   C&C6CCC	C
CC	 C	N)0rK   rb   rc   r   r=  r  r  rt  r|  r  r  rs  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r&  r  r6  r  rK  r  rR  r_  re  r  r  r  r  r  r  r  r  r  r  r  r  r   r%   r#   r\  r\  L  s        H$ $ $& & &- - -^A A A2B B B,$ $ $204 04 04dA A A	% 	% 	%& & &A A A:L L LG G G<	, 	, 	,$, $, $,L6 6 6@ @ @% % %N
 
 
 5 5 5:	? 	? 	?E E E- - -2C C C4 4 4%? %? %?N: : :4+ + +
D D D? ? ?*A A AD D D4*2 *2 *2X? ? ?C C C4, , ,(!3 !3 !3F3 3 35 5 5*6 6 64 4 4<; ; ;,; ; ; ; ;r%   r\  c                       e Zd ZdZdS )SubclassDatetimer&   NrX  r   r%   r#   r  r    rZ  r%   r  c                   N   e Zd ZeZd Zd Zd Zd Zd Z	d Z
d Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z ej        d          d             Zd Z ej        d          d             Zd Zd Zd Z d Z!d Z" e#j$        e%j&        dk    d           d!             Z' e#j$        e%j&        dk    d           d"             Z(d# Z)d$ Z*d% Z+d& Z,d' Z-d( Z.d) Z/d* Z0 ej        d+          d,             Z1d- Z2d. Z3d/ Z4d0 Z5d1 Z6d2 Z7d3 Z8d4 Z9d5 Z:d6 Z;d7 Z<d8 Z=d9 Z>d:S );TestDateTimec                    |                      ddddd          }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           d S )Nr^  rU   r&   r   r   	r=  r0   r_  r`  r  rf  r  r  rj  rx   s     r#   r  z"TestDateTime.test_basic_attributes  s    ]]4Ar1--$'''1%%%###"%%%A&&&A&&&+++++r%   c           	         |                      ddddddd          }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           d S )Nr^  rU   r&   r   r   @  r  rx   s     r#   test_basic_attributes_nonzeroz*TestDateTime.test_basic_attributes_nonzero  s     ]]4Ar2r488$'''1%%%###"%%%B'''B'''.....r%   c           
         |                      ddddddd          | j                                         fD ]}t          |          }|                     |                    d                     |d	d          }t          |          }|                     ||           |                      |j        |j        |j	        |j
        |j        |j        |j                  }|                     ||           d S )
Nr&   rY   rU   r[   rV   r]   rX   r  r  )r=  r   r   r   rD   r   r0   r_  r`  r  rf  r  r  rj  rc  s       r#   r  zTestDateTime.test_roundtrip  s    ==Aq!Q155=$$&&( 	& 	&B RAOOALL55666!""Aq''CR%%% --26 "BI "0 0C R%%%%	& 	&r%   c           
      r	   |                      ddddddd          }|                     |                                d           |                     |                    d          d           |                     |                    d	          d
           |                     |                    d          d           |                     |                    d          d           |                     |                    d          d           |                     |                    d          d           |                     |                    d          d           |                     |                    d          d           |                     |                    d          d           |                     |                    d          d           |                     |                    d	d          d           |                     t          |j        d           |                     t          |j        d           |                     t          |          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dd          }|                     |                    d          d           |                     |                    d          d           |                     |                    d          d!           |                      ddd          }|                     |                                d"           |                     |                    d          d"           |                     |                    d	          d#           |                     t          |          d#           t          t          d$%          d&          }|                      ddd|          }|                     |                                d'           d S )(Nr&   rY   rU   r[   rV   r  z0001-02-03T04:05:01.000123r   z0001-02-03 04:05:01.000123 z0001-02-03 04:05:01.000123r  u   0001-02-0304:05:01.000123r   timespecz0001-02-03T04rj   z0001-02-03T04:05r   z0001-02-03T04:05:01rU  z0001-02-03T04:05:01.000r   auto)sepr  z0001-02-03 04:05fooL@ r   z0001-02-03T04:05:01.999+00:00z0001-02-03T04:05:01.999z0001-02-03T04:05:01.000000z0002-03-02T00:00:00z0002-03-02 00:00:00   r   XXXz0002-03-02T00:00:00+00:00:16)
r=  r0   r  r   r   r   r   r6   re   r   r  s      r#   r  zTestDateTime.test_isoformat  s.   MM!Q1aC00+GHHHS))+GHHHS))+GHHHV,,.MNNNX..:	< 	< 	<g66HHHi88:LMMMi88:OPPPn==?XYYYn==?[\\\f557STTTyAACUVVV*akEBBB*akHEEEQ!=>>>MM!Q1aF8<MHHn==?^___MM!Q1aF33n==?XYYYMM!Q1a++f557LMMMn==?XYYYn==?[\\\MM!Q""+@AAAS))+@AAAS))+@AAAQ!67772...66MM!Q"M--(FGGGGGr%   c                    dt          d          fdt          d          fdt          dd	          fd
t          ddd          fdt          dddd          fg}ddt          j        fdt          t          d                    fg}|d |D             z  }|                     dddddd          }d}|D ]N\  }}|                    |          }||z   }|                     |          5  d d d            n# 1 swxY w Y   Od S )N05:00rV   r   02:00rY   06:27r]   r.  r   12:32:30r   r   r  r'  02:04:09.123456r[   r  rg  r)  r  N+00:00r   c                 R    g | ]$\  }}d D ]\  }}||z   t          ||z            f%S ))-r  )+r&   r   r!   r	  r[  prefixsigns        r#   r$   z8TestDateTime.test_isoformat_timezone.<locals>.<listcomp>4  ]     
 
 
" 5
 
  h 3 34
 
 
 
r%   r  r&   %   z2016-04-01T12:37:09r   tzir   r   r6   r=  r  r3  )	r1   	tzoffsetstzinfosdt_baseexp_baseexp_tzr  ry   exps	            r#   test_isoformat_timezonez$TestDateTime.test_isoformat_timezone%  s   ia((()ia((()ia4445RDDDE	1aV\ ] ] ]^
	 x|$x	!--.
 	 
 
 )
 
 
 	
 --aBA66(" 	- 	-KFC,,BV#C#&& - - - - - - - - - - - - - - - - -	- 	-s   .C;;C?	C?	c           	         |                      ddddddd          }|                     |                    d          t          |                     |                     t
          d	          5  |                    d           d d d            n# 1 swxY w Y    G d
 d| j                   } |ddddddd          }|                     |                    d          d            G d d| j                   } |ddddddd          }|                     |                    d          t          |                     dD ]}|                     |                    |          |                    |                     |                     |                    |          |                    |                     |                     |                    |          d           d S )Nr  r  r'   r[   rV   r&   r  r  r  c                       e Zd Zd ZdS )#TestDateTime.test_format.<locals>.Ac                     dS r  r   r7   s    r#   r  z+TestDateTime.test_format.<locals>.A.__str__L  r   r%   Nr  r   r%   r#   r  r"  K  r  r%   r  c                       e Zd Zd ZdS )#TestDateTime.test_format.<locals>.Bc                     dS r  r   r  s     r#   r  z,TestDateTime.test_format.<locals>.B.strftimeS  r   r%   Nr
  r   r%   r#   r  r%  R  r  r%   r  r  r  r  s          r#   r  zTestDateTime.test_formatC  s?   ]]4B1a55r**CGG444##I/EFF 	 	MM#	 	 	 	 	 	 	 	 	 	 	 	 	 	 		 	 	 	 	 	 	 	 AdAr1aC((b))3///	 	 	 	 	 	 	 	 AdAr1aC((b))3r77333 	5 	5C R]]3//S1A1ABBBQ\\#..C0@0@AAAQ\\#..4444	5 	5s   -BBBc           	      v   dd l }|                     ddddddd          }|                     |                                d           |                     ddd	dddd          }|                     |                                 |j         |j        |                                                               d S )
Nr   r^  rU   rY      rV   r  zSat Mar  2 18:03:05 2002r  )r   r=  r0   r  r  r  )r1   r   r   s      r#   test_more_ctimezTestDateTime.test_more_ctime`  s    MM$1b!Q44$>??? MM$2r1a55JDJ{t{1;;==/I/I$J$JKKKKKr%   c           	         |                      dddddd          }|                      dddddd          }|                      dddddd          }|                     ||           |                     ||k               |                      t          ddd	d
d
d          }t	          d          }||z   }|                     ||z
  |           |                     ||k                d S )Nr^  rU   r&   r  r   r'   r   r  r   r   ri  r   )r=  r0   r   r   r   )r1   r   rT  dt3rq  s        r#   test_tz_independent_comparingz*TestDateTime.test_tz_independent_comparingp  s    mmD!Q1a00mmD!QAq11mmD!Q1a00c"""c	""" mmGRRR@@A&&&BhsB'''c	"""""r%   c                      G d dt                     }|                     ddddddd |dd                    }|                     t          |j        d           d S )	Nc                       e Zd Zd ZdS )DTestDateTime.test_strftime_with_bad_tzname_replace.<locals>.MyTzInfoc                 >     G d dt                     } |d          S )Nc                       e Zd Zd ZdS )ZTestDateTime.test_strftime_with_bad_tzname_replace.<locals>.MyTzInfo.tzname.<locals>.MyStrc                     d S r4   r   )r1   r   s     r#   r  zbTestDateTime.test_strftime_with_bad_tzname_replace.<locals>.MyTzInfo.tzname.<locals>.MyStr.replace  s    #tr%   N)rK   rb   rc   r  r   r%   r#   MyStrr2    s#        $ $ $ $ $r%   r4  rF   )r   )r1   ry   r4  s      r#   r}   zKTestDateTime.test_strftime_with_bad_tzname_replace.<locals>.MyTzInfo.tzname  s<    $ $ $ $ $C $ $ $ uV}}$r%   N)rK   rb   rc   r}   r   r%   r#   MyTzInfor/    s#        % % % % %r%   r5  r  rU   rY   r   rF   %Z)re   r=  r   r   r  )r1   r5  r   s      r#   %test_strftime_with_bad_tzname_replacez2TestDateTime.test_strftime_with_bad_tzname_replace  sy    	% 	% 	% 	% 	%{ 	% 	% 	% MM$1aAq((1f2E2EFF)QZ66666r%   c                 	   |                      t          dd           |                      t          dd           |                     t          | j         t          dz
  dd           |                     t          | j         t          dz   dd           |                      ddd           |                      ddd           |                     t          | j         ddd           |                     t          | j         ddd           |                      ddd           |                      ddd           |                      d	dd           |                     t          | j         ddd
           |                     t          | j         ddd           |                     t          | j         ddd           |                     t          | j         ddd           |                     t          | j         ddd           |                     t          | j         ddd           |                      dddd           |                      dddd           |                     t          | j         dddd           |                     t          | j         dddd           |                      ddddd           |                      ddddd           |                     t          | j         ddddd           |                     t          | j         ddddd           |                      dddddd           |                      dddddd           |                     t          | j         dddddd           |                     t          | j         dddddd           |                      ddddddd           |                      ddddddd           |                     t          | j         ddddddd	  	         |                     t          | j         ddddddd	  	         |                     t          | j         dddd           |                     t          | j         dddd           |                     t
          | j         dddddddd d           d S )Nr&   rS  r   r   r  rY   r~  r  r  r  r  r  r  r   r  r   r  r/  r   rX  r(  r  fold)r=  r   r   r   r   r   r7   s    r#   r  z+TestDateTime.test_bad_constructor_arguments  sf   gq!$$$gq!$$$*dmWQY1EEE*dmWQY1EEEdAq!!!dB"""*dmT1a@@@*dmT2qAAAdAr"""dAr"""dAr"""*dmT1bAAA*dmT1bAAA*dmT1bAAA*dmT1bAAA*dmT1a@@@*dmT1bAAAdAr1%%%dAr2&&&*dmT1b"EEE*dmT1b"EEEdAr2q)))dAr2r****dmT1b"bIII*dmT1b"bIIIdAr2r1---dAr2r2...*dmT1b"b"MMM*dmT1b"b"MMMdAr2r2q111dAr2r2v666*dm2r2r2	7 	7 	7*dm2r2r!	# 	# 	# 	*dm2B 	 	0 	0 	0*dm2A 	 	/ 	/ 	/ 	)T]2r2r1dA	? 	? 	? 	? 	?r%   c                 ~   |                      dddddd          }|                      dddddd          }|                     ||           |                     t          |          t          |                     |di}d||<   |                     t          |          d           |                     ||         d           |                     ||         d           |                      d	ddd
dd          }|                      d	ddd
dd          }|                     ||           |                     t          |          t          |                     |di}d||<   |                     t          |          d           |                     ||         d           |                     ||         d           d S )NrS  r   r  r   r     r&   rY   r  r   rV   r  r  s       r#   r  zTestDateTime.test_hash_equality  s   MM$BB33MM$BB33Aa$q''***!fAS1%%%Q###Q###MM$QQ33MM$QQ33Aa$q''***!fAS1%%%Q###Q#####r%   c                    |                      ddd          |                      ddd          }|z
  }|                     |j        dt          t	          ddd                    z              |                     |j        d           |                     |j        d           |                      ddd	d
d          t          ddd          }t          dd          }t          d          t          d          }|                     |z   |                      ddd	dd                     |                     |z   |                      ddd	dd                     |                     d|z  z   |                      ddddd                     |                     |z
  |                      ddd	dd                     |                     | z   |                      ddd	dd                     |                     |z
  | z              |                     d|z  z
  |                      ddddd                     |                     z   |                      dddd
d                     |                     z
  |                      dddd
d                     |                     |z   |                      dddd
d                     |                     |z
  |                      dd	dd
d                     |                     d|z  z   |                      dddd
d                     |                     d|z  z
  |                      dddd
d                     |                     |z   z
  |           |                     z   z
             |                     |z   z
  |           |                     |z   z
  |           |                     |z
  z
  |            |                     z
  z
              |                     |z
  z
  |            |                     |z
  z
  |            |                     |z   z
  |            |                     z   z
              |                     |z   z
  |            |                     |z   z
  |            |                     |z
  z
  |           |                     z
  z
             |                     |z
  z
  |           |                     |z
  z
  |           |                     |z   |z   |z   z   |                      ddddddd                     |                     |z   |z   |z   z   |z   z   |z   |z              |                     |z   |z   |z   z
  |                      dd	ddddd                     |                     |z   |z   |z   z
  |z
  z
  |z
  |z
             dD ]~|                     t          fd           |                     t          fd           |                     t          fd            |                     t          fd!           |                     t          fd"           |                     t          fd#           |                     t          fd$           |                     t          fd%           |                     t          fd&           |                     t          fd'           |                     t          fd(           |                     t          fd)           d S )*Nr^  r&   r  r  r  r[   r   rU   rY   r<  r]   rY  r  rX   r(  r'   r  r<  r   r  r   r  r  r  r  rV   r   r^  ru  c                       z   S r4   r   rx  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  ry  r%   c                       z
  S r4   r   rx  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  ry  r%   c                       z   S r4   r   rx  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  ry  r%   c                       z
  S r4   r   rx  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  ry  r%   c                       z
  S r4   r   r  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  r  r%   c                       z  S r4   r   r  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  r  r%   c                       z  S r4   r   r  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  r  r%   c                       z  S r4   r   r  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  r  r%   c                       z  S r4   r   r  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  r  r%   c                        z  S r4   r   r  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  r  r%   c                        z  S r4   r   r  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  r  r%   c                        z   S r4   r   r  s   r#   rE  z0TestDateTime.test_computations.<locals>.<lambda>	  r  r%   r  )	r1   ro  r  millisecrf  r  rn  r  rr  s	         @@@r#   rs  zTestDateTime.test_computations  s   MM$2&&MM$2&&sFStT11E1E-F-F$FGGGq)))*A...MM$1b!,,Q4((D!!ll||T4==q!R#C#CDDD4==q!R#C#CDDDRWdmmD!Q1&E&EFFFT4==q!R#C#CDDD$DMM$1b!$D$DEEET1u9---RWdmmD!QA&F&FGGGS$--aB"B"BCCCS$--aB"B"BCCCT4==q!R#C#CDDDT4==q"b!#D#DEEERWdmmD!QA&F&FGGGRWdmmD!QA&F&FGGG!d(a...!c'Q,,,!d(a...!h,!+X666!d(a$///!c'Q---!d(a$///!h,!+hY777a$h$///a#g---a$h$///a(l+hY777a$h...a#g,,,a$h...a(l+X666dSj4/(:;tQB1dCC	E 	E 	EdSj4/(:;H+t3x?	A 	A 	AdSj4/(:;tQB2vFF	H 	H 	HdSj4/(:;H+t3x?	A 	A 	A  	6 	6Ai555i555i555i5555 	)_____555)_____555)_____555)%5%5%5%5%5666)%5%5%5%5%5666)]]]]333)^^^^444)]]]]33333r%   c                 2   d} | j         | }t          D ]G\  }}}|                    ||          }|                    |          }|                     ||           H|                     |                                |                    d                     d S )Nr]   rX   r   r<  r   r&      rY   r)  r  s           r#   r  zTestDateTime.test_pickling	  s    )t}d#)7 	, 	,%GYMM$..Eooe,,GT7++++**D,>,>q,A,ABBBBBr%   c           	      n   |                      ddddddd          }t          t          j        dz             D ]|}t          j        ||          }t          j        |          }|                     |j        d           |                     |j        d           |                     |j	        d           }d S )	Nr  rY   rX   r  0   r  i r&   )
r=  rl  r    HIGHEST_PROTOCOLr   r   r0   r_  r`  r  )r1   rn  r"   r  ro  s        r#   test_more_picklingzTestDateTime.test_more_pickling&	  s    MM$1b"b&9962Q677 	' 	'EQ&&AQAQVT***QWa(((QUA&&&&	' 	'r%   c                 
   d}t          | }t          D ]o\  }}}|                    ||          }|                    |          }|                     ||           |                     t          |t                                pd S )NrL  )r  r   r   r   r0   r   rk   r  s           r#   test_pickling_subclass_datetimez,TestDateTime.test_pickling_subclass_datetime/	  s    )&)7 	C 	C%GYMM$..Eooe,,GT7+++OOJw0@AABBBB		C 	Cr%   c                     g d}d} | j         | }|D ]/}t          D ]%} ||d          }|                     ||           &0d S )N)s@   cdatetime
datetime
(S'\x07\xdf\x0b\x1b\x14;\x01\x00\x10\x00'
tR.s#   cdatetime
datetime
(U
;  tR.s$   cdatetime
datetime
U
;  R.)r-  r   r.  r<  r   r&   rM  r/  r0  r2  r4  s          r#   r6  z!TestDateTime.test_compat_unpickle8	  s    	
 	
 	
 . 4=$' 	4 	4D% 4 4%x888  (33334	4 	4r%   c                 :   g d} | j         | } | j         | }|                     ||           |                     ||k               |                     ||k               |                     ||k               |                     ||k                |                     ||k               t	          t          |                    D ]Q}|d d          }||         dz   ||<    | j         | }|                     ||k                |                     ||k               |                     ||k               |                     ||k               |                     ||k               |                     ||k               |                     ||k               |                     ||k               |                     ||k               |                     ||k                |                     ||k               |                     ||k               Sd S )N)rS  r   r~  r<  r  r  ri  r&   )r=  r0   r   r   rl  r  )r1   r   r  r  rr  r]  s         r#   test_more_comparezTestDateTime.test_more_compareJ	  s    211T]D!T]D!R   b!!!b!!!r"""b!!!b!!!s4yy!! 	' 	'A111gGa1GAJ(BOOBG$$$OOBG$$$OOB"H%%%OOB"H%%%OOB"H%%%OOB"H%%%R2X&&&R2X&&&R"W%%%R"W%%%R2X&&&R2X&&&&	' 	'r%   c                    |                      |j        |j                   |                      |j        |j                   |                      |j        |j                   |                      |j        |j                   |                      |j	        |j
                   |                      |j        |j                   d S r4   )r0   r  r_  r  r`  r  r  r   rf  r!  r  r"  r  )r1   r	  r^  s      r#   verify_field_equalityz"TestDateTime.verify_field_equalityk	  s    )38444#)444)37333)38444#*555#*55555r%   c                     dd l } |j                     } |j        |          }| j                            |          }|                     ||           d S Nr   )r   	localtimer=  r  rX  r1   r   r  r	  r^  s        r#   r  zTestDateTime.test_fromtimestamps	  sZ    TY[[!4>"%%m))"--""8S11111r%   c                     dd l } |j                     } |j        |          }| j                            |          }|                     ||           d S rZ  )r   gmtimer=  utcfromtimestamprX  r\  s        r#   test_utcfromtimestampz"TestDateTime.test_utcfromtimestamp{	  sX    TY[[4;r??m,,R00""8S11111r%   EST+05EDT,M3.2.0,M11.1.0c           	      f   |                      ddd          }|                     |                                d           |                      ddddddd          }|                     |                                d           |                      ddd	dd
          }|                    d          }|                     | j                             |                                          |t          d          z
             |                     | j                             |                                          |t          d          z              |                      dd	ddd
          }|                     | j                             |                                          |           |                      ddd          |                      ddd          fD ]U}	 |                                }|                     | j                             |          |           F# t          $ r Y Rw xY wd S )NrO  r&   g     @rY   rU   r[    6@rc  r   r  r9  r   i'  r   )r=  r0   r  r  r  r   r  )r1   r   t0r  r  s        r#   test_timestamp_naivez!TestDateTime.test_timestamp_naive	  s   MM$1%%000MM$1aAq11;	= 	= 	= ]]4B2..ZZQZ44R\\^^DDia0000	2 	2 	244R\\^^DDia0000	2 	2 	2 MM$Aq"--44Q[[]]CCQGGG --!A&&d2b(A(AB 	D 	DADKKMM   !<!<Q!?!?CCCC !   	D 	Ds   H!!
H.-H.c                    |                      dddt          j                  }|                     |                                d           |                      dddddddt          j                  }|                     |                                d           |                      dddddddt          t          d	
          d                    }|                     |                                d           d S )NrO  r&   r   r  rY   rU   r[   g7  @r  r   r   rc  )r=  r   r6   r0   r  r   r  s     r#   test_timestamp_awarez!TestDateTime.test_timestamp_aware	  s    MM$1X\M::,,,MM$1aAqMFF1	3 	3 	3MM$1aAq!))"*=*=*=u!E!E  G G9	; 	; 	; 	; 	;r%   zMSK-03c                    | j         j        | j         j        fD ]K} |d          }|                     |j        d           |                     |j        d            |d          }	  |d          }|                     |j        d           |                     |j        d            |d          }|                     ||            |d          }|                     ||            |d          }|                     ||            |d	          }|                     |j        d           |                     |j        d
           n# t          $ r Y nw xY w |d          }|                     ||            |d          }|                     ||            |d          }|                     |j        d           |                     |j        d            |d          }|                     |j        d           |                     |j        d            |d          }|                     |j        d           |                     |j        d           Md S )Nr   gư>gưr   r(  g:0yEg1E2gHzr  i# gHz>g1E2>g<"2?gP?r&   r  r  )r=  r  r_  r0   r  rj  OSError)r1   ftsr  r  	minus_oner   s         r#   r  z&TestDateTime.test_microsecond_rounding	  s   M/M24 %	2 %	2C3q66DT[!,,,T-q111#d))C8CJJ	
   !12666  !6???CJJ  D)))CJJ  I...CJJ  D)))CLL  2...  7777    " D		AQ%%%D		AQ$$$JAQXq)))Q]F333IAQXq)))Q]A...FAQXq)))Q]D1111K%	2 %	2s   )E
EEc                    |                      d          5  | j        j                            t          j                  }|                                }|                     |d           d d d            n# 1 swxY w Y   |                      d          5  | j        j                            t          j        d          }|                                }|                     |d           d d d            d S # 1 swxY w Y   d S )Nzminimum UTCr   l w#o9 zmaximum UTCr   r   rj  g  MB)	r3  r=  r   r  r   r6   r  r0   r   )r1   min_dtmin_tsmax_dtmax_tss        r#   test_timestamp_limitsz"TestDateTime.test_timestamp_limits	  sv   \\-(( 	3 	3]&..hl.CCF%%''F V\222	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 \\-(( 	5 	5]&..hl;< / > >F%%''F V^444	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5s%   AA77A;>A;AC::C>C>c                    	 | j                             d           n,# t          t          f$ r |                     d           Y nw xY w| j         j        t          d          z   }|                                }| j         j        	                    d          }| j         j        t          d          z
                                  t          d	d
d
          
                                z   }d||fd||ffD ]f\  }}}|                     |||          5  | j                             |          }|                     ||           d d d            n# 1 swxY w Y   gd|t          dd          
                                z
  fd|t          d          
                                z
  fd|t          d          
                                z   fd|t          d          
                                z   fg}	|	D ]\  }}|                     ||          5  |                     t          t          f          5  | j                             |           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d S )N    Test not valid on this platformr&   rV  r   rj  r   r   r  r   r'  minimummaximumr  r	  Too small by a littler   r  Too small by a lotr  Too big by a littleToo big by a lotr  )r=  r  ri  r  rL   r   r   r  r   r  r  r3  r0   r   r   )
r1   rn  ro  rp  rq  	test_namer  r	  r  r  s
             r#   test_fromtimestamp_limitsz&TestDateTime.test_fromtimestamp_limits	  s`   	=M''
3333' 	= 	= 	=MM;<<<<<	=
 "YA%6%6%66!!##"**q*99=$yr':':'::EEGG"b"===KKMMN FF+FF+*
 	3 	3%YH iBBB 3 344R88  2223 3 3 3 3 3 3 3 3 3 3 3 3 3 3 %fyar/J/J/J/X/X/Z/Z&Z[!6I3,?,?,?,M,M,O,O#OP"FYA->->->-L-L-N-N$NO)*=*=*=*K*K*M*M!MN	

 ( 	4 	4MIriB// 4 4&&
M'BCC 4 4 M//3334 4 4 4 4 4 4 4 4 4 4 4 4 4 44 4 4 4 4 4 4 4 4 4 4 4 4 4 4	4 	4sW    &AA1EE	E	"I8:I!I8!I%%I8(I%)I88I<	?I<	c                    	 | j                             d           n,# t          t          f$ r |                     d           Y nw xY w| j         j                            t          j                  }|	                                }| j         j
                            dt          j                  }|	                                }d||                    d           fd||                    d           ffD ]\  }}}|                     |||          5  	 | j                             |          }n@# t          t          f$ r,}	|                     t          |	                     Y d }	~	nd }	~	ww xY w|                     ||           d d d            n# 1 swxY w Y   d	|d
z
  fd|t          d                                          z
  fd|d
z   fd|t          d                                          z   fg}
|
D ]\  }}|                     ||          5  |                     t"          t          f          5  | j                             |           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d S )Nrt  ru  r   r   rj  r   rw  rx  ry  rz  r&   r{  r  rV  r|  r}  r~  )r=  r_  ri  r  rL   r   r  r   r6   r  r   r3  r   r0   r   r  r   r   )r1   rn  ro  rp  rq  r  r  r	  r  excr  s              r#   test_utcfromtimestamp_limitsz)TestDateTime.test_utcfromtimestamp_limits
  sl   	=M**:6666' 	= 	= 	=MM;<<<<<	= "**(,*??!!##"**q*NN!!## FFNN$N$?$?@FFNN$N$?$?@*
 
	3 
	3%YH iBBB 3 3,!];;B??FF/ , , ,MM#c((++++++++,   2223 3 3 3 3 3 3 3 3 3 3 3 3 3 3 %fqj1!6I3,?,?,?,M,M,O,O#OP"FQJ/)*=*=*=*K*K*M*M!MN	

 ( 	7 	7MIriB// 7 7&&
M'BCC 7 7 M2226667 7 7 7 7 7 7 7 7 7 7 7 7 7 77 7 7 7 7 7 7 7 7 7 7 7 7 7 7	7 	7s    &AAFD32F3E0"E+&F+E00FF	F	"I9;I"I9"I&&I9)I&*I99I=	 I=	c                 \    dD ](}|                      t          | j        j        |           )d S r  r  r  s     r#   r  z&TestDateTime.test_insane_fromtimestamp6
  r  r%   c                 \    dD ](}|                      t          | j        j        |           )d S r  )r   r  r=  r_  r  s     r#   test_insane_utcfromtimestampz)TestDateTime.test_insane_utcfromtimestamp?
  sF    
 $ 	& 	&FmT]-K$& & & &	& 	&r%   win32z*Windows doesn't accept negative timestampsc                 :    | j                             d           d S )N)r=  r  r7   s    r#   !test_negative_float_fromtimestampz.TestDateTime.test_negative_float_fromtimestampH
  s      	##E*****r%   c                     | j                             d          }|                     ||                      ddddddd                     d S )	Nr  i  r   r  r   r   r  i~ )r=  r_  r0   )r1   r  s     r#   $test_negative_float_utcfromtimestampz1TestDateTime.test_negative_float_utcfromtimestampN
  sK    M**511DMM$BBFKKLLLLLr%   c                 N   dd l }t          d          }t          d          D ]Z}| j                                        }| j                             |j                               }t          ||z
            |k    r n[|                     t          ||z
            |           d S )Nr   r&   r   rU   )r   r   rl  r=  utcnowr_  rk  assertLessEqual)r1   r   	tolerancer  from_nowfrom_timestamps         r#   test_utcnowzTestDateTime.test_utcnowS
  s     a(((	1XX 	 	E}++--H!];;IDIKKHHN>H,--:: ; 	S(!:;;YGGGGGr%   c                 t   d}d}t          j        | j        ||          }| j                            ||          }|                     ||           |                     t          |          | j                   |                     t          |          | j                   g d}|D ]\  }}|                     ||          5  t          j        | j        ||          }| j                            ||          }|                     ||           d d d            n# 1 swxY w Y   | j        j        }|                      |dd                                          dt          z             |                      |dd                                          d	t          z             |                      |d
d                                          t          ddd                      ddt          j         t          j        d         ffD ]\  }}|dk     rd}	| }
nd}	|}
t          |
dz  d          \  }}d                    |	|||          } ||d          }|                     |                                t          |                     |                     |                                |           d\  }} |||          }|                     |                                dt           z  dt          z  z              |                     |                                d           |                     |                    |          |           |                      |dd          j        d            |                     t(                    5   |dd           d d d            n# 1 swxY w Y   |                     t(                    5   |dd           d d d            n# 1 swxY w Y   |                     t(                    5   |dd           d d d            d S # 1 swxY w Y   d S )Nz2004-12-01 13:02:47.197z%Y-%m-%d %H:%M:%S.%f))u   2004-12-0113:02:47.197u   %Y-%m-%d%H:%M:%S.%f)u   200412-01 13:02:47.197u   %Y%m-%d %H:%M:%S.%f)u   2004-12-01 13:0247.197u   %Y-%m-%d %H:%M%S.%f)stringformatz+0002%zrY   z-0002rW   z-00:02:01.000003r&   rU   )rj   r   r   )r   r   )r   GMTr   r  r  rX  z{}{:02d}{:02d} {}r  r   )z	+1234 UTCr  r   r  r   r6  z-2400z-000z)	_strptime_strptime_datetimer=  strptimer0   r5   r   r3  rz   MINUTEr   r  r   r}   r"  r  r  r  r   r   r   )r1   r  r  r	  r^  inputsr  	tzsecondsr}   r  r   r   rj   dtstrry   r  s                   r#   test_strptimezTestDateTime.test_strptimea
  s   *'/vvNNm$$VV443'''d8nndm444d3ii///
 
 

 % 	0 	0NFFVF;; 0 0$7v8>@ @m,,VV<<  3///	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 =)'400::<<a&jIII'400::<<b6kJJJH'..88::q!!<<<<	
 	
 	

 #-j#(>/5<?!C"E 	2 	2Iv1}}$*##GRK44NE7'..tUGVLLE%))BR\\^^Yy-I-I-IJJJRYY[[&1111)
sXeS!!dR&[)@AAAe,,,S))5111 	%..5t<<<z**CCHHWd,C,C,CCCCCCCCCCCCCCCCz**BBHHVT,B,B,BBBBBBBBBBBBBBBBz**??HHS$,?,?,???????????????????sI   ADD 	#D 	N00N47N4O..O25O2P--P14P1c                    | j         j        }|                     t                    5   |dd          }d d d            n# 1 swxY w Y   |                      dddddd          }|                      dddddd          }|                      dddd	d	d	          }|                      ddd
d	d	d	          }ddd|fddd|fddd|fddd|fddd|fddd|fddd|fddd|fddd|fd dd!|fg
}|D ]a\  }}	}
}d"|z   }|                     ||	|
|#          5   ||	|
          }|                     |||$           d d d            n# 1 swxY w Y   bd S )%Nz01/02/3 04:05:06z%d/%m/%y %H:%M:%Sr  rY   r&   r[   rV   r]   r      rP  z1/02/03 4:5:6r  z01/2/03 4:5:6z%Hz01/02/03 4:05:06z%Mz01/02/03 04:5:06z%Sz01/02/03 04:05:6z%jz2/03 04am:05:06z%j/%y %I%p:%M:%Sz%Iz02/03 4am:05:06z%wz6/04/03z%w/%U/%yz%Wz6/4/2003z%u/%W/%Yz%Vz%u/%V/%Gztest single digit )reasonr  r  target)msg)r=  r  r   r   r3  r0   )r1   r  newdater   rT  r+  dt4r  r  r  r  r  s               r#   test_strptime_single_digitz'TestDateTime.test_strptime_single_digit
  sj    =)z** 	H 	Hh13FGGG	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H mmD!Q1a00mmD!Q1a00mmD!Q1a00mmD!RAq11?$7=?$7=%':C@%':C@%':C@$&8=$&8=9j#.:z3/:z3/
 /5 	> 	>*FFFF)F2FV%+%+%+  - - > > #(6622  &f ===> > > > > > > > > > > > > > >	> 	>s#   A  AA%D??E	E	c                    |                      dddddd          }|                     |                                d           |                     |                                |j        |j        |j        |j        |j        |j        |	                                |
                                t          |j        dd          
                                z
  dz   d	f	           |                                }|                     |j        |j                   |                     |j        |j                   |                     |j        |j                   |                     |j        |j                   |                     |j        |j                   |                     |j        |j                   |                     |j        |	                                           |                     |j        |
                                t          |j        dd          
                                z
  dz              |                     |j        d	           d S )
Nr  r   r  r]   r  !   )	r  r   r  r]   r  r  r[   re  r  r&   r  )r=  r0   r  r_  r`  r  rf  r  r  r  rh  r   r  r  r  r   r!  r"  r#  r$  r%  )r1   r   tts      r#   test_more_timetuplez TestDateTime.test_more_timetuple
  s   MM$B2r22(MNNN&!'15&!(AH))++++--$qvq!*<*<*F*F*H*HH1L		 	 	 [[]]QV,,,AG,,,QU+++QV,,,AH---AH---QYY[[111Q[[]]%)!&!Q%7%7%A%A%C%C&DFG&H 	I 	I 	Ib)))))r%   c           	         |                      ddddddd          }|                     |                    d          d	           d
D ]j\  \  }}}t          t	          d||                     }|                    |          }|                     |                    d          d|z              k	 |                    d           d S # t          $ r Y d S w xY w)Nr  r   r  r]   r  r  /   z%m %d %y %f %S %M %H %jz12 31 04 000047 33 22 06 366)))r  r  z	33.000123))r  r   33rY   )r   r   r   r   r  z-0200u   %y%m %H%M)r=  r0   r  r   r   r  r  )r1   r   r  rq  r  r   s         r#   test_more_strftimezTestDateTime.test_more_strftime
  s    MM$B2r266$=>>$B	D 	D 	DF 	< 	<JGQQ91abIIIIJJB			$$AQZZ--w{;;;;	JJ./////! 	 	 	DD	s   3C
 

CCc           	         |                      ddddddd          }|                     |                                t          ddd                     |                     |                                t          dddd                     d S )Nr^  rU   r[   r(  -     )r=  r0   r   r   rx   s     r#   test_extractzTestDateTime.test_extract
  s{    ]]4Ar2q$77Dq!$4$4555DRD$9$9:::::r%   c           	         t          ddd          }t          dddd          }|                     ddddddd          }| j        j        } |||          }|                     ||            |||          }|                     ||           |                     ||                                            |                     ||                                           |                     | ||                                 |                                                     |                     t          |           |                     t          ||           |                     t          |||           |                     t          |||d           |                     t          |||dd	           |                     t          |d
d           |                     t          ||d           |                     t          |d
|            |||t          j                  }| 	                    |j
        t          j                    |||t          j                  }| 	                    |j
        t          j                   t                      } |||          }|                     |                                 |           |                     |                                |           d S )Nr^  rU   r[   r(  r  r  )r   r   r&   rY   r   r   r   )r   r   r=  r  r0   r   r   r   r6   r5   r   )r1   r  r   r	  r  ry   s         r#   test_combinezTestDateTime.test_combine
  s   q!RD!!==q!RQ==-'WQ]]X&&&W!!$$$X&&&BGGII&&&BGGII&&&WWRWWYY		::;;;)W---)Wa000)Wa333)WaA666)WaAq999)Wff===)Wa888)Wfa888 WQ8<((bi...WQ(,///bi...FFWR^^A&&&A&&&&&r%   c                 d   | j         }g d} || }|                     ||                                           d}dD ]C\  }}|d d          }|||<    || } |j        d
i ||i}	|                     ||	           |dz  }D |ddd          }|                     t          |j        d	           d S )N)r&   rY   rU   r[   rV   r]   rX   r   )rT  rU  rV  rf  rV   r  r]   r  rX   rj  r  r&   rS  rY   r~  r  rW  r   rX  rY  s
             r#   r_  zTestDateTime.test_replace  s    m$$$sDzt||~~...1 	 	LD& 111gGGAJsG}H$,00$00CXs+++FAA s4B*dl>>>>>r%   EDT4c                    | j                                         }t          dd          }|                    t	          t          d          d                    }|                     |                                |           |                     t          |j        ||           |                     t          |j        |           |                    |          t          dd          z   }|                     |                    |          |           |                     |                    |	          |            G d
 dt                    } |            }|                     t          |j        |           |                     |                    |                              |          |            G d dt                    } |            }|                     t          |j        |            G d dt                    }	 |	            }
|                    |
          }|                     t                    5  |                                 d d d            d S # 1 swxY w Y   d S )N,   0044r\   r   EDTr   r[   r   r   c                       e Zd Zd Zd ZdS )+TestDateTime.test_astimezone.<locals>.Bogusc                     d S r4   r   rx   s     r#   rz   z5TestDateTime.test_astimezone.<locals>.Bogus.utcoffset1      DDr%   c                      t          d          S rZ  r   rx   s     r#   r   z/TestDateTime.test_astimezone.<locals>.Bogus.dst2  s    ill2r%   NrK   rb   rc   rz   r   r   r%   r#   Bogusr  0  s"        00022222r%   r  c                       e Zd Zd Zd ZdS )/TestDateTime.test_astimezone.<locals>.AlsoBogusc                      t          d          S rZ  r   rx   s     r#   rz   z9TestDateTime.test_astimezone.<locals>.AlsoBogus.utcoffset8  s    IaLL%8r%   c                     d S r4   r   rx   s     r#   r   z3TestDateTime.test_astimezone.<locals>.AlsoBogus.dst9      ddr%   Nr  r   r%   r#   	AlsoBogusr  7  s"        888*****r%   r  c                       e Zd Zd Zd ZdS ),TestDateTime.test_astimezone.<locals>.Brokenc                     dS r  r   rx   s     r#   rz   z6TestDateTime.test_astimezone.<locals>.Broken.utcoffset>  s    AAr%   c                     dS r  r   rx   s     r#   r   z0TestDateTime.test_astimezone.<locals>.Broken.dst?      aar%   Nr  r   r%   r#   Brokenr  =  s"        ---'''''r%   r  )r=  r   re   r  r   r   r0   
astimezoner   r   r   r   )r1   ry   r  dt_utcdt_fr  bogr  alsobogr  broken	dt_brokens               r#   test_astimezonezTestDateTime.test_astimezone$  s   ]  F##8IB,?,?,?#G#GHH&111)R]Aq999)R]B777zzz##ia&D&D&DDq))4000!,,d333	3 	3 	3 	3 	3F 	3 	3 	3 egg*bmS9993//::1==tDDD	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ )++*bmW===	( 	( 	( 	( 	(V 	( 	( 	( JJfJ--	y)) 	# 	#  """	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#s   I**I.1I.c                      G  fdd j                   }d}  j         | } ||i ddi}                     |j        |                                |j        d                                |j        d                                |                                |                                                                |                    d          |j        |j        z   |j	        z   dz
             d S )Nc                   $    e Zd ZdZ fdZd ZdS ).TestDateTime.test_subclass_datetime.<locals>.Crf   c                     |                                 }|                    d          } j        j        | g|R i |}||_        |S rj  rk  rm  s         r#   r   z6TestDateTime.test_subclass_datetime.<locals>.C.__new__J  rq  r%   c                 6    || j         z   | j        z   | j        z   S r4   )r_  r`  r  rs  s     r#   ru  z6TestDateTime.test_subclass_datetime.<locals>.C.newmethQ  s    ty(4:5CCr%   Nrv  r7   s   r#   rx  r  G  sG        I    D D D D Dr%   rx  )r  r[   rd  r   r  )   r   rX   rf   rZ   )
r=  r0   rJ   rw  r   rh  ru  r_  r`  r  rz  s   `    r#   r  z#TestDateTime.test_subclass_datetimeE  s)   	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 'dmT"a&'1&&***+++A&&&#--//:::R#(SY*>*-*+578+9 	: 	: 	: 	: 	:r%   c                      G  fdd j                   }d}d}d} || }                     ||                                |j        d           |                                }d|f|fd|t
          j        f|                    t
          j                  fd|f|fd	|f|fd
|df|fdt          |dd          t          |dd           f|fg}|D ]\  }}	}
||fD ]} 
                    t          |          |          5  t          ||          } ||	 }                     ||                                ||
                                |j        d           d d d            n# 1 swxY w Y   d S )Nc                       e Zd Z fdZdS )TTestDateTime.test_subclass_alternate_constructors_datetime.<locals>.DateTimeSubclassc                 B     j         j        | g|R i |}d|_        |S r  r  r  s       r#   r   z\TestDateTime.test_subclass_alternate_constructors_datetime.<locals>.DateTimeSubclass.__new__c  r  r%   Nr  r7   s   r#   r  r  b  r  r%   r  )r  r[   rd  r   r     rg  z2003-04-14T12:30:15.123456gh͏TMArX   r  r_  r  r  z%Y-%m-%dT%H:%M:%S.%fr  r   rU   r  )r=  r   r0   r   r  r   r6   r  r   r   r3  r   r  )r1   r  r   r  utc_tsr  r  r  r  r  r	  r  constructorry   s   `             r#   -test_subclass_alternate_constructors_datetimez:TestDateTime.test_subclass_alternate_constructors_datetime`  s>   	 	 	 	 	 	 	t} 	 	 	 12"!!4(f&6777q)))  reV,r8<0%00>>@&F3{nf5+'=>GtAaCy)4abb?;VD	

 3= 	2 	2.Kh-v6 2 2\\X.9 " ; ; 2 2")(K"@"@K$k2B ))".>??? $$R222 $$RXq1112 2 2 2 2 2 2 2 2 2 2 2 2 2 22	2 	2s   AE**E.1E.c                      G  fdd j                   }ddi fddi fdddt          j        ifdddt          t          d	          d
          ifg}|D ]|\  }}}                     |          5  t          ||          } |di |}                     ||                                |j        d           d d d            n# 1 swxY w Y   }d S )Nc                       e Zd Z fdZdS )8TestDateTime.test_subclass_now.<locals>.DateTimeSubclassc                 B     j         j        | g|R i |}d|_        |S r  r  r  s       r#   r   z@TestDateTime.test_subclass_now.<locals>.DateTimeSubclass.__new__  r  r%   Nr  r7   s   r#   r  r    r  r%   r  r   r  now_utcr   	now_fixedr  r   r   rX   r   )	r=  r   r6   r   r3  r  r   r0   r   )r1   r  r  rF   	meth_namer  r  ry   s   `       r#   test_subclass_nowzTestDateTime.test_subclass_now  si   	 	 	 	 	 	 	t} 	 	 	 E2x$hl34%$1D1D1De(L(L!MN	

 (2 	. 	.#D)Vd## . . !19==V%%f%%%%b*:;;;  1---. . . . . . . . . . . . . . .	. 	.s   0A
CC
	C
	c                    	 g d}g dddg}d t           j        t          t          d                    t          t          d                    g	 	fd|D             }|D ]{}|D ]v}|                    |	          }                     |
          5   j                            |          }                     ||           d d d            n# 1 swxY w Y   w|d S )N)r  r  r  r  )r   r   r   r   )r   r   r   ih )r   r   r   G )r   r  r  r  r  r  r  r   rY   c           	      H    g | ]}D ]}D ]} j         g ||R d |iS r   )r=  )r!   
date_tuple
time_tupler  
base_timesr1   r  s       r#   r$   z<TestDateTime.test_fromisoformat_datetime.<locals>.<listcomp>  st     # # #!+# #!# #  t}BjB:BBBcBB # # # # #r%   r   r  )r   r6   r   r  r3  r=  r  r0   )
r1   r  
separatorsdtsry   r   r  r  r  r  s
   `       @@r#   test_fromisoformat_datetimez(TestDateTime.test_fromisoformat_datetime  su   
 
 


 
 

 3Z
IB///00IA...//1# # # # # #!+# # #
  	0 	0B! 0 0--\\\.. 0 0 M77>>E$$R///0 0 0 0 0 0 0 0 0 0 0 0 0 0 00	0 	0s   1CCCc           
      `   |                      ddddddd          }t          d          t          d          t          d	d
          t          ddd          t          dddd          g}|d |D             z  }d t          j        t          t          d                    g}|d |D             z  }|D ]t}|                    |          }|                                }|                     |          5  | j                             |          }d d d            n# 1 swxY w Y   ud S )Nr   r   r  r  pQ rV   r   rY   r]   r.  r   r   r'  r[   r  rg  r)  c                     g | ]}d |z  S r  r   r!   r[  s     r#   r$   z<TestDateTime.test_fromisoformat_timezone.<locals>.<listcomp>      222"b2g222r%   r   c                 ,    g | ]}t          |          S r   r   r  s     r#   r$   z<TestDateTime.test_fromisoformat_timezone.<locals>.<listcomp>      555RHRLL555r%   r   tstrr=  r   r   r6   r  r  r3  r  )r1   base_dtr  r  r  ry   r  r  s           r#   test_fromisoformat_timezonez(TestDateTime.test_fromisoformat_timezone  s   --b"b"b&AA A	 2 2 2Ar***BB777Aq!&III	
	 	22	2222	IA...//1 	5595555 	* 	*C,,BLLNNE5)) * *33E::* * * * * * * * * * * * * * *		* 	*s   ;D""D&	)D&	c           
      6   g d}|D ]}|                      ddddddd          }|                    |	          }|                     |
          5  | j                             |          }|                     ||           d d d            n# 1 swxY w Y   d S )N)	r  r     u   ʁu   ᛇu   時u   🐍r  r  r&   r  r   r   r  iu r  r  r  r1   r  r   ry   r  r  s         r#   test_fromisoformat_separatorsz*TestDateTime.test_fromisoformat_separators  s    
 
 

  	, 	,CtQBB??BLLSL))EE** , ,33E::  U+++, , , , , , , , , , , , , , ,		, 	,s   1BB	B	c                 2   ddg}|D ]}|                      ddddd          }|                    |          }|                     |	          5  | j                             |          }|                     ||           d d d            n# 1 swxY w Y   d S )
Nr  r  r  r&   r  r   r  r  r  r  r  s         r#   test_fromisoformat_ambiguousz)TestDateTime.test_fromisoformat_ambiguous  s    3Z
 	, 	,CtQB33BLLSL))EE** , ,33E::  U+++, , , , , , , , , , , , , , ,		, 	,s   1BB	B	c           
      v   ddg}d t           j        t          t          d                    t          t          d                    t          t          dd                    g}g d	}t          |          D ]\  }}|D ]}|D ]}|d
k    rd|d         dz  z  }|dd         |fz   } | j        |dd|z            d|i}	|	                    |          }
|                     |
          5  | j                            |
          }|                     |	|           d d d            n# 1 swxY w Y   d S )N)r  r   r[   r  r<  r  rg  )r  r   r[   r  r<  r  r   r  r   rY   r]   r.  r   r   rj   r   rU  r   rU  rY  r   r[   r   r  r  	r   r6   r   	enumerater=  r  r3  r  r0   )r1   datetime_basesr  	timespecsipr  r  r  new_microsecondsry   r  r  s               r#   test_fromisoformat_timespecsz)TestDateTime.test_fromisoformat_timespecs  s   ,') IB///00IA...//IAr:::;;=
5 5 5	  	** 	4 	4FB 
4 
4 . 	4 	4H^+++/8A;$3F+G(#+AaC=4D3F#F&!QV*)=KsKKBLL"L55EE22 4 4 $ ; ;E B B((U3334 4 4 4 4 4 4 4 4 4 4 4 4 4 4	4
4	4 	4   .1D+	+D/2D/c                    t           j        }t          t          d          d          }t          t          d          d          }t          t          d          d          }g d|                     d	dd
dd          fd|                     d	dd
dd          fd|                     d	dd
dd          fd|                     d	dd
dd          fd|                     d	dd
ddd          fd|                     d	dd
ddd          fd|                     d	dd
dddd          fd|                     d	dd
dddd          fd|                     d	dd
dddd          fd|                     d	dd
dddd          fd|                     d	dd
dddd          fd|                     d	dd
dddd          fd|                     d	dd
dddd          fd|                     d	dd
dddd          fd|                     d dd!dd"d#d$          fd%|                     d dd!dd"d#d&          fd'|                     d	dd
dddd          fd(|                     d	dd
dd          fd)|                     d	dd
dd          fd*|                     d	dd
dd          fd+|                     d	dd
ddd          fd,|                     d	dd
ddd          fd-|                     d	dd
dddd          fd.|                     d	dd
dddd          fd/|                     d	dd
dddd          fd0|                     d	dd
dddd          fd1|                     d	dd
dddd          fd2|                     d	dd
dddd          fd3|                     d	dd
dddd          fd4|                     d	dd
dddd          fd5|                     d6dd          fd7|                     d6d8d9d:d          fd;|                     d<ddd:d          fd=|                     d	d8d>d?d          fd@|                     d	d8dAd?d          fdB|                     dCd8dDdd          fdE|                     d	dd
dd          fdF|                     dCd8dDd8d          fdG|                     d	dd
d8d          fdH|                     d	dd
d8dIdA          fdJ|                     d	d8dAd?dK          fdL|                     d	d8dAd?dK          fdM|                     d<ddd:dKdN          fdO|                     d<ddd:dKdN          fdP|                     d	dd
d8dIdA          fdQ|                     d	dd
ddd          fdR|                     d	dd
ddd          fdS|                     dTdd
ddd          fdU|                     dTddddd          fdV|                     d	dd
ddd          fdW|                     d	dd
dddd          fdX|                     d	dd
d8dIdA          fdY|                     d	dd
d8dIdAdZ          fd[|                     d	d8dAd?dK          fd\|                     d	d8dAd?dK          fd]|                     d<ddd:dKdN          fd^|                     d<ddd:dKdNd_          fd`|                     dCd8dDdd|a          fdb|                     d	dd
ddd|a          fdc|                     d	dd
ddd|a          fdd|                     d	dd
dddd|a          fde|                     dfddddt          t          dK                    a          fdg|                     d	dd
dddht          t          d                    a          fdi|                     d	dd
dddht          t          dj                    a          fdk|                     d	dd
ddd|a          fdl|                     d	dd
dddht          t          d                    a          fdm|                     d	dd
dddht          t          dj                    a          fdn|                     dodddddpdq|a          fdr|                     dodddddpdq|a          fds|                     dodhddddhdt|a          fdu|                     dodhddddhdt|a          fdv|                     dTdwdAddD|a          fdx|                     dTdwdAddD|a          fdy|                     d	dd
dddd|a          fdz|                     d	dd
ddddt          t          dw{                    a          f}|D ]c\  }}|                     ||          5  | j                            |          }|                     ||           d d d            n# 1 swxY w Y   dd S )}Nr&   r   BSTr  r   r\   r  r  r  rY   r   z2025-01-02T03rU   z2025-01-02T03:04r[   z2025-01-02T0304z2025-01-02T03:04:05rV   z2025-01-02T030405z2025-01-02T03:04:05.6i'	 z2025-01-02T03:04:05,6z2025-01-02T03:04:05.678ipX
 z2025-01-02T03:04:05.678901[
 z2025-01-02T03:04:05,678901z2025-01-02T030405.678901z2025-01-02T030405,678901z2025-01-02T03:04:05.6789010z2009-04-19T03:15:45.2345r  r  r  r  i z2009-04-19T03:15:45.1234567rg  z2025-01-02T03:04:05,678r  20250102T03z20250102T03:04z20250102T03:04:0520250102T030405z20250102T03:04:05.6z20250102T03:04:05,6z20250102T03:04:05.678z20250102T03:04:05,678z20250102T03:04:05.678901z20250102T030405.678901z20250102T030405,678901z20250102T030405.67890102022W01r  
2022W52520r   r   r<  2022W527520r  
2026W01516r~  r  2026W013516r  
2025W01503r  r  2025W014503
2025W015122025W0145122025W014T121431rd  2026W013T162100r   z2026W013 1621002022W527T202159r   z2022W527 202159z2025W014 1214312025W014T030405z2025W014 030405z2020-W53-6T03:04:05r  z2020W537 03:04:05z2025-W01-4T03:04:05z2025-W01-4T03:04:05.678901z2025-W01-4T12:14:31z2025-W01-4T12:14:31.012345i90  z2026-W01-3T16:21:00z2026-W01-3T16:21:00.000000z2022-W52-7T20:21:59z2022-W52-7T20:21:59.999999r(  z2025-W01003+00r   z2025-01-02T03:04:05+00z2025-01-02T03:04:05Zz!2025-01-02003:04:05,6+00:00:00.00z2000-01-01T00+21rS  z2025-01-02T03:05:06+0300r]   z2025-01-02T03:05:06-0300rT   z2025-01-02T03:04:05+0000z2025-01-02T03:05:06+03z2025-01-02T03:05:06-03z 2020-01-01T03:05:07.123457-05:00r  rX   iA z2020-01-01T03:05:07.123457-0500z 2020-06-01T04:05:06.111111-04:00i z2020-06-01T04:05:06.111111-0400z 2021-10-31T01:30:00.000000+01:00r'   z2021-10-31T01:30:00.000000+0100z2025-01-02T03:04:05,6+000000.00z 2025-01-02T03:04:05,678+00:00:10r   r  )r   r6   r   r=  r3  r  r0   )	r1   r   r   r   r  r  r  r	  r  s	            r#   $test_fromisoformat_datetime_examplesz1TestDateTime.test_fromisoformat_datetime_examples  s   lyq)))511yr***E22yr***E22z
4==q!Q::;z
dmmD!Q1==>z
  tQ1a!@!@Az
 dAq!Q ? ?@	z

 #DMM$1aA$F$FGz
 !$--aAq!"D"DEz
 %]]4Aq!Q779z
 %]]4Aq!Q779z
 ']]4Aq!Q779z
 *]]4Aq!Q779z
 *]]4Aq!Q779z
" (]]4Aq!Q779#z
& (]]4Aq!Q779'z
* +]]4Aq!Q779+z
. (]]4B2r6::</z
2 +]]4B2r6::<3z
6 ']]4Aq!Q7797z
: tQ1a889;z
< DMM$1a;;<=z
> t}}T1aA>>??z
@ !$--aAq!"D"DEAz
B dAq!Q B BCCz
D #]]4Aq!Q779Ez
H #]]4Aq!Q779Iz
L %]]4Aq!Q779Mz
P %]]4Aq!Q779Qz
T (]]4Aq!Q779Uz
X &]]4Aq!Q779Yz
\ &]]4Aq!Q779]z
` ']]4Aq!Q779az
d dAq112ez
f 4==r2r1==>gz
h DMM$1b!<<=iz
j 4==r2r1==>kz
l DMM$BA>>?mz
n 4==r2q!<<=oz
p DMM$1a;;<qz
r 4==r2r1==>sz
t DMM$1b!<<=uz
v dAq"b" E EFwz
x dBB C CDyz
z dBB C CD{z
| dAq"b" E EF}z
~ dAq"b" E EFz
@ dAq"b" E EFAz
B dAq!Q B BCCz
D dAq!Q B BCEz
F #DMM$1aA$F$FGGz
H !$--aAq!"D"DEIz
J #DMM$1aA$F$FGKz
L *]]4Aq!Q779Mz
P #DMM$1b"b$I$IJQz
R *]]4Ar2r599;Sz
V #DMM$BB$G$GHWz
X *4==r2r2+N+NOYz
Z #]]4Ar2r224[z
^ *]]4Ar2r6::<_z
b ]]4RAc]::<cz
f &]]4Aq!Qs];;=gz
j $]]4Aq!Qs];;=kz
n 1]]4Aq!Qs]CCEoz
r  ]]4Aq!HYR=P=P=P4Q4Q]RRTsz
v (]]4Aq!Q"*91+=+=+=">">  @ @Awz
| (]]4Aq!Q"*92+>+>+>"?"?  A AB}z
B (]]4Aq!Qs];;=Cz
F &]]4Aq!Q"*91+=+=+=">">  @ @AGz
L &]]4Aq!Q"*92+>+>+>"?"?  A ABMz
R 0]]4Aq!Qs]CCESz
V /]]4Aq!Qs]CCEWz
Z 0]]4Aq!Qs]CCE[z
^ /]]4Aq!Qs]CCE_z
b 0]]4RBs];;=cz
f /]]4RBs];;=gz
j /]]4Aq!Qs]CCEkz
n 0]]4Aq!Q"*9R+@+@+@"A"A  C CDoz
x $, 	3 	3Ix	22 3 344Y??  2223 3 3 3 3 3 3 3 3 3 3 3 3 3 3	3 	3s   1g  g	g	c                    g d}|D ]|}|                      |          5  |                     t                    5  | j                            |           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   }d S )N)r  r  z2009.04-19T03z2009-04.19T03z2009-04-19T0az2009-04-19T03:1a:45z2009-04-19T03:15:4az2009-04-19T03;15:45z2009-04-19T03:15;45z2009-04-19T03:15:4500:00z 2009-04-19T03:15:45.123456+24:30z 2009-04-19T03:15:45.123456-24:30u   2009-04-10ᛇᛇᛇᛇᛇ12:15u   2009-0410T12:15u   2009-04-10T1215z2009-04-19T1z2009-04-19T12:3z2009-04-19T12:30:4z2009-04-19T12:z2009-04-19T12:30:z2009-04-19T12:30:45.z2009-04-19T12:30:45.123456+z2009-04-19T12:30:45.123456-z!2009-04-19T12:30:45.123456-05:00az2009-04-19T12:30:45.123-05:00az2009-04-19T12:30:45-05:00ar  r3  r   r   r=  r  r  s      r#   !test_fromisoformat_fails_datetimez.TestDateTime.test_fromisoformat_fails_datetime  s   
 
 
:   	9 	9Gg.. 9 9&&z22 9 9M//8889 9 9 9 9 9 9 9 9 9 9 9 9 9 99 9 9 9 9 9 9 9 9 9 9 9 9 9 9	9 	94   A8A!A8!A%%A8(A%)A88A<	?A<	c                     d}|                      t          t          j        t	          |                              5  | j                            |           d d d            d S # 1 swxY w Y   d S )Nu   2018-01-0301:0113)r  r   reescaper   r=  r  )r1   r  s     r#   "test_fromisoformat_fails_surrogatez/TestDateTime.test_fromisoformat_fails_surrogate  s     *##J	$u++0F0FGG 	/ 	/M''...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/s   A%%A),A)c                     d}| j                             |          }|                     |j        t          j                   d S )Nz2014-04-19T13:21:13+00:00)r=  r  r5   r   r   r6   )r1   r  ry   s      r#   test_fromisoformat_utcz#TestDateTime.test_fromisoformat_utc  s:    ,]((00bi.....r%   c                 0    G d d| j                   } |ddddddd	t          t          d
d                              }|                    |                                          }|                     ||           |                     ||           d S )Nc                       e Zd ZdS )BTestDateTime.test_fromisoformat_subclass.<locals>.DateTimeSubclassNr  r   r%   r#   r  r?    r  r%   r  r   r   rd  r  r  r  i r'   r   r   )r=  r   r   r  r  r0   r   )r1   r  ry   r  s       r#   r  z(TestDateTime.test_fromisoformat_subclass  s    	 	 	 	 	t} 	 	 	 dBAr2v%-ib".M.M.M%N%NP P P !..r||~~>>U###e%566666r%   N)?rK   rb   rc   r   r=  r  r  r  r  r  r  r)  r,  r7  r  r  rs  r  rQ  rS  r6  rV  rX  r  r`  r   run_with_tzre  rg  r  rr  r  r  r  r  unittestskipIfrI   platformr  r  r  r  r  r  r  r  r  r_  r  r  r  r  r   r  r  r  r  r1  r5  r:  r<  r  r   r%   r#   r  r    s       H, , ,
/ 
/ 
/& & & *H *H *HX- - -<5 5 5:L L L # # #$	7 	7 	73? 3? 3?j$ $ $.B4 B4 B4HC C C' ' 'C C C4 4 4$' ' 'B6 6 62 2 22 2 2 W344D D 54D6	; 	; 	; W""&2 &2 #"&2P5 5 5&%4 %4 %4N%7 %7 %7N& & && & & X_S\W,.Z[[+ + \[+
 X_S\W,.Z[[M M \[MH H H9@ 9@ 9@v >  >  >D* * *,   ; ; ;
 '  '  'D? ? ?2 W  # # ! #@: : :6/2 /2 /2b. . .0!0 !0 !0F* * *2, , ,"	, 	, 	,4 4 44D3 D3 D3L"9 "9 "9H/ / // / /
7 
7 
7 
7 
7r%   r  c                   D    e Zd ZeZ ej        d          d             ZdS )TestSubclassDateTimeznot appropriate for subclassesc                     d S r4   r   r7   s    r#   r  z#TestSubclassDateTime.test_roundtrip  s    r%   N)rK   rb   rc   r  r=  rA  skipr  r   r%   r#   rE  rE    s@        HX]344  54  r%   rE  c                       e Zd ZdZdS )SubclassTimer&   NrX  r   r%   r#   rI  rI    rZ  r%   rI  c                       e Zd ZeZd Zd Zd Zd Zd Z	d Z
d Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )TestTimec                 
   |                      dd          }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           d S )Nr   r   r=  r0   rf  r  r  rj  r  s     r#   r  zTestTime.test_basic_attributes  s{    MM"a  $$$1%%%1%%%*****r%   c                    |                      dddd          }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           d S )Nr   r   r  rM  r  s     r#   r  z&TestTime.test_basic_attributes_nonzero  s     MM"b"d++$$$2&&&2&&&-----r%   c                    |                      dddd          }t          |          }|                     |                    d                     |dd          }t	          |          }|                     ||           |                      |j        |j        |j        |j	                  }|                     ||           d S )Nr&   rY   rU   r[   r  r  )
r=  r   r   rD   r   r0   rf  r  r  rj  )r1   r   r  r  s       r#   r  zTestTime.test_roundtrip  s    MM!Q1%% GG[11222abbE!WWB ]]1618QX=* *Br%   c                    g d} | j         |  | j         | }|                     |           |                     |k               |                     |k               |                     |k               |                     |k                |                     |k               t	          t          |                    D ]Q}|d d          }||         dz   ||<    | j         | }|                     |k                |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k               |                     |k                |                     |k               |                     |k               St          D ]c|                     k    d           |                     k    d           |                     k    d           |                     k    d           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd	           |                     t          fd
           |                     t          fd           |                     t          fd           ed S )Nr&   rY   rU   r[   r&   FTc                       k    S r4   r   r  s   r#   rE  z)TestTime.test_comparing.<locals>.<lambda>/  r  r%   c                       k     S r4   r   r  s   r#   rE  z)TestTime.test_comparing.<locals>.<lambda>0  r  r%   c                       k    S r4   r   r  s   r#   rE  z)TestTime.test_comparing.<locals>.<lambda>1  r  r%   c                       k    S r4   r   r  s   r#   rE  z)TestTime.test_comparing.<locals>.<lambda>2  r  r%   c                       k    S r4   r   r  s   r#   rE  z)TestTime.test_comparing.<locals>.<lambda>3  r  r%   c                       k     S r4   r   r  s   r#   rE  z)TestTime.test_comparing.<locals>.<lambda>4  r  r%   c                       k    S r4   r   r  s   r#   rE  z)TestTime.test_comparing.<locals>.<lambda>5  r  r%   c                       k    S r4   r   r  s   r#   rE  z)TestTime.test_comparing.<locals>.<lambda>6  r  r%   )	r=  r0   r   r   rl  r  r  r   r   )r1   r   r  rr  r]  r  r  s        @@r#   test_comparingzTestTime.test_comparing  s   ||T]D!T]D!R   b!!!b!!!r"""b!!!b!!!s4yy!! 	' 	'A111gGa1GAJ(BOOBG$$$OOBG$$$OOB"H%%%OOB"H%%%OOB"H%%%OOB"H%%%R2X&&&R2X&&&R"W%%%R"W%%%R2X&&&R2X&&&&  	? 	?FR6\5111R6\4000Vr\5111Vr\4000i)=)=)=)=)=>>>i)<)<)<)<)<===i)<)<)<)<)<===i)=)=)=)=)=>>>i)=)=)=)=)=>>>i)<)<)<)<)<===i)<)<)<)<)<===i)=)=)=)=)=>>>>	? 	?r%   c                    |                      dd           |                      dd           |                     t          | j         dd           |                     t          | j         dd           |                      dd           |                      dd           |                     t          | j         dd           |                     t          | j         dd           |                      ddd           |                      ddd           |                     t          | j         ddd           |                     t          | j         ddd           |                      dddd           |                      dddd           |                     t          | j         dddd           |                     t          | j         dddd           d S )	Nr   r   r  r/  r   rX  r(  r  )r=  r   r   r7   s    r#   r  z'TestTime.test_bad_constructor_arguments8  s   ab!*dmR;;;*dmR;;;b!b"*dmR<<<*dmR<<<b"a   b"b!!!*dmRR@@@*dmRR@@@b"b!$$$b"b&)))*dmRRDDD*dmRRIIIIIr%   c                 f   |                      ddd          }|                      ddd          }|                     ||           |                     t          |          t          |                     |di}d||<   |                     t          |          d           |                     ||         d           |                     ||         d           |                      ddd          }|                      ddd          }|                     ||           |                     t          |          t          |                     |di}d||<   |                     t          |          d           |                     ||         d           |                     ||         d           d S )Nr   r  r<  r&   rY   r   rV   r  r  s       r#   r  zTestTime.test_hash_equalityN  s   MM"b"%%MM"b"%%Aa$q''***!fAS1%%%Q###Q###MM!a$$MM!a$$Aa$q''***!fAS1%%%Q###Q#####r%   c                    |                      dddd          }|                     |                                d           |                     |                                t          |                     |                                  }|                     |                                d           |                     |                                t          |                     |                      d          }|                     |                                d           |                     |                                t          |                     |                      d	          }|                     |                                d
           |                     |                                t          |                     |                      d          }|                     |                                d           |                     |                                t          |                     |                      d          }|                     |                                d           |                     |                                t          |                     |                      d          }|                     |                                d           |                     |                                t          |                     |                      d          }|                     |                                d           |                     |                                t          |                     |                      dddd          }|                     |                    d          d           |                     |                    d          d           |                     |                    d          d           |                     |                    d          d            |                     |                    d!          d"           |                     |                    d#          d"           |                     t
          |j        d$           |                     t
          |j        d%           |                      dddd&          }|                     |                    d          d'           |                      dddd(          }|                     |                    d          d)           |                     |                    d!          d*           |                     |                    d#          d           d S )+Nr[   rV   r&   r  z04:05:01.00012300:00:00rv  z00:00:00.000001r'   z00:00:00.000010r  z00:00:00.000100rY  z00:00:00.001000ra  z00:00:00.010000順 z00:00:00.100000r   r  r  rg  )rf  r  r  rj  r   r  12rj   z12:34r   z12:34:56rU  z12:34:56.123r   z12:34:56.123456r  monkeyr  r  z12:34:56.999r   z12:34:56.000z12:34:56.000000)r=  r0   r  r   r   r   r  s     r#   r  zTestTime.test_isoformate  s   MM!Q3''(9:::A///MMOO
333A///MMaM(((9:::A///MMbM))(9:::A///MMcM**(9:::A///MMdM++(9:::A///MMeM,,(9:::A///MMfM--(9:::A///MMr"RVMLLg66===i88'BBBi88*EEEn==~NNNn==?PQQQf557HIII*akHEEE*akHEEEMMr"RVMLLn==~NNNMMr"RQMGGn==~NNNn==?PQQQf55zBBBBBr%   c                    dt          d          fdt          d          fdt          dd	          fd
t          ddd          fdt          dddd          fg}ddt          j        fdt          t          d                    fg}|d |D             z  }|                     ddd          }d}|D ]N\  }}|                    |          }||z   }|                     |          5  d d d            n# 1 swxY w Y   Od S )Nr  rV   r   r  rY   r  r]   r.  r   r	  r   r   r  r'  r
  r[   r  rg  r)  r  r  r   c                 R    g | ]$\  }}d D ]\  }}||z   t          ||z            f%S r  r   r  s        r#   r$   z4TestTime.test_isoformat_timezone.<locals>.<listcomp>  r  r%   r  z12:37:09r   r  r  )	r1   r  r  t_baser  r  r  r   r  s	            r#   r  z TestTime.test_isoformat_timezone  s   ia((()ia((()ia4445RDDDE	1aV\ ] ] ]^
	 x|$x	!--.
 	 
 
 )
 
 
 	
 r2q))" 	, 	,KFCc**AV#C#&& , , , , , , , , , , , , , , , , ,	, 	,s   +C88C<	?C<	c                 v    |                      d          }|                     t          |j        d           d S )Nr&   r  rU   )r  )r=  r   r   r  r  s     r#   test_1653736zTestTime.test_1653736  s8    MMM##)Q[a88888r%   c                 (   |                      dddd          }|                     |                    d          d           |                     |                    d          d           	 |                    d	           d S # t          $ r Y d S w xY w)
Nr&   rY   rU   r[   z%H %M %S %fz01 02 03 000004r  r  u   %H%M)r=  r0   r  r  r  s     r#   r  zTestTime.test_strftime  s    MM!Q1%%M224EFFFK00':::	JJ|$$$$$! 	 	 	DD	s   ,B 
BBc                    |                      dddd          }|                     |                    d          t          |                     |                     t
          d          5  |                    d           d d d            n# 1 swxY w Y    G d d	| j                   } |dddd          }|                     |                    d          d	            G d
 d| j                   } |dddd          }|                     |                    d          t          |                     dD ]}|                     |                    |          |                    |                     |                     |                    |          |                    |                     |                     |                    |          d           d S )Nr&   rY   rU   r[   r  r  r  c                       e Zd Zd ZdS )TestTime.test_format.<locals>.Ac                     dS r  r   r7   s    r#   r  z'TestTime.test_format.<locals>.A.__str__  r   r%   Nr  r   r%   r#   r  rk    r  r%   r  c                       e Zd Zd ZdS )TestTime.test_format.<locals>.Bc                     dS r  r   r  s     r#   r  z(TestTime.test_format.<locals>.B.strftime  r   r%   Nr
  r   r%   r#   r  rn    r  r%   r  )z%H %M %Sr  )r1   r   r  rn  r  ro  r  s          r#   r  zTestTime.test_format  s#   MM!Q1%%b))3q66222##I/EFF 	 	LL	 	 	 	 	 	 	 	 	 	 	 	 	 	 		 	 	 	 	 	 	 	 AaAqMMb))3///	 	 	 	 	 	 	 	 AaAqMMb))3q66222 	5 	5CQ\\#..

3@@@Q\\#..

3@@@Q\\#..4444		5 	5s   *BBBc           
      @   |                      t          |                     dddd                    d           |                      t          |                     dddd                    d           |                      t          |                     d	ddd
                    d           |                      t          |                     dddd	                    d           |                      t          |                     ddd	d	                    d           d S )Nr&   rY   rU   r[   z01:02:03.000004r'   r  z10:02:03.004000r   r  z00:02:03.400000r   z12:02:03r   r  z23:15:00)r0   r   r=  r7   s    r#   r   zTestTime.test_str  s    T]]1aA66779JKKKT]]2q!T::;;=NOOOT]]1aF;;<<>OPPPT]]2q!Q7788*EEET]]2r1a8899:FFFFFr%   c           
      |   d| j         j        z   }|                     t          |                      dddd                    d|z             |                     t          |                      dddd                    d	|z             |                     t          |                      d
ddd                    d|z             |                     t          |                      dddd
                    d|z             |                     t          |                      ddd
d
                    d|z             d S )Nr  r&   rY   rU   r[   z%s(1, 2, 3, 4)r'   r  z%s(10, 2, 3, 4000)r   r  z%s(0, 2, 3, 400000)r   z%s(12, 2, 3)r   r  z
%s(23, 15)r  r  s     r#   r   zTestTime.test_repr  sG   T]33dmmAq!Q7788)D0	2 	2 	2dmmB1d;;<<-4	6 	6 	6dmmAq!V<<==.5	7 	7 	7dmmB1a8899'$.	0 	0 	0dmmBAq99::%,	. 	. 	. 	. 	.r%   c                 >   |                      | j        j        | j                   |                      | j        j        | j                   |                      | j        j        t
                     |                     | j        j        | j        j        k               d S r4   )r   r=  r   r   r  r   r   r7   s    r#   r  zTestTime.test_resolution_info  s~    dm/???dm/???dm6	BBB)DM,==>>>>>r%   c                 2   d} | j         | }t          D ]G\  }}}|                    ||          }|                    |          }|                     ||           H|                     |                                |                    d                     d S )Nr<  r   r  rM  rY   r)  r  s           r#   r  zTestTime.test_pickling  s     t}d#)7 	, 	,%GYMM$..Eooe,,GT7++++**D,>,>q,A,ABBBBBr%   c                 
   d}t          | }t          D ]o\  }}}|                    ||          }|                    |          }|                     ||           |                     t          |t                                pd S )Nrt  )rI  r   r   r   r0   r   rk   r  s           r#   test_pickling_subclass_timez$TestTime.test_pickling_subclass_time  s     T")7 	? 	?%GYMM$..Eooe,,GT7+++OOJw==>>>>		? 	?r%   c                 
   g d}t          |          D ]n\  }\  }}|                     |          5   | j        | }t          D ]%} ||d          }|                     ||           &	 d d d            n# 1 swxY w Y   od S )N))s,   cdatetime
time
(S'\x14;\x10\x00\x10\x00'
tR.rt  )s   cdatetime
time
(U;  tR.rt  )s   cdatetime
time
U;  R.rt  )s,   cdatetime
time
(S'\x14;\x19\x00\x10\x00'
tR.r<  r   r  rM  )s   cdatetime
time
(U;  tR.rx  )s   cdatetime
time
U;  R.rx  )rr  r/  r0  )r  r3  r=  r3  r0   )r1   r  rr  r5  r   r	  r   r   s           r#   r6  zTestTime.test_compat_unpickle  s    
 
 
  )// 	8 	8OA|d"" 8 8(4=$/) 8 8E#eD8<<<G$$Wh777788 8 8 8 8 8 8 8 8 8 8 8 8 8 8	8 	8s   8A77A;	>A;	c                    | j         }|                      |d                     |                      |dd                     |                      |ddd                     |                      |dddd                     |                      |d                     |                      |                       d S )Nr&   r   )r=  r   )r1   rZ  s     r#   r  zTestTime.test_bool%  s    mAAq		"""Aq!%%%Aq!Q(((Ar%   c                 ,   | j         }g d} || }|                     ||                                           d}dD ]C\  }}|d d          }|||<    || } |j        di ||i}	|                     ||	           |dz  }D |d          }|                     t          |j        d           |                     t          |j        d           |                     t          |j        d	
           |                     t          |j        d           d S )NrQ  r   )r  r  r  r  r&   r/  rf  r  r  r  rf  r  rv  r   rX  rY  s
             r#   r_  zTestTime.test_replace/  s=   m||sDzt||~~...1 		 		LD& 111gGGAJsG}H$,00$00CXs+++FAA s1vv*dl<<<*dl2>>>*dl3???*dlHHHHHr%   c                      G d d| j                   } |dd          }|                     t          |                    d                    |           d S )Nc                       e Zd ZdS )4TestTime.test_subclass_replace.<locals>.TimeSubclassNr  r   r%   r#   TimeSubclassr  I  r  r%   r  r   r  r'   r{  rd  )r1   r  r  s      r#   re  zTestTime.test_subclass_replaceH  sq    	 	 	 	 	4= 	 	 	 R$$d5==b=1122LAAAAAr%   c                      G  fdd j                   }d}  j         | } ||i ddi}                     |j        |                                |j        d                                |j        d                                |                                |                                                                |                    d          |j        |j        z   dz
             d S )Nc                   $    e Zd ZdZ fdZd ZdS )&TestTime.test_subclass_time.<locals>.Crf   c                     |                                 }|                    d          } j        j        | g|R i |}||_        |S rj  rk  rm  s         r#   r   z.TestTime.test_subclass_time.<locals>.C.__new__T  rq  r%   c                 &    || j         z   | j        z   S r4   rf  r  rs  s     r#   ru  z.TestTime.test_subclass_time.<locals>.C.newmeth[      ty(4;66r%   Nrv  r7   s   r#   rx  r  Q  B        I    7 7 7 7 7r%   rx  )r[   rV   r]   r   rX   rf   rZ   )	r=  r0   rJ   rw  r   r  ru  rf  r  rz  s   `    r#   test_subclass_timezTestTime.test_subclass_timeO  s   	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 dmT"a&'1&&***+++A&&&#--//:::R#(SZ*?!*CDDDDDr%   c           	      ^   d}ddt          d          dfD ].}|                     t          | j        ||dd          z              /|                     t          d          5  |                     t          dgt          |          z            d           d d d            d S # 1 swxY w Y   d S )	Nz2:59.0r  9r/     ÿr&   r  r   )chrr   r   r=  r  r  r  )r1   r[  	hour_bytes      r#   r  z!TestTime.test_backdoor_resistancei  s    c3r77F2 	? 	?Ii)2T!""X)=? ? ? ? ##I/GHH 	9 	9MM%c$ii00%888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9s    5B""B&)B&N)rK   rb   rc   r   r=  r  r  r  rZ  r  r  r  r  rg  r  r  r   r   r  r  rv  r6  r  r_  re  r  r  r   r%   r#   rK  rK    sz       H+ + +. . .     )? )? )?VJ J J,$ $ $.2C 2C 2Ch, , ,<9 9 9

 
 
5 5 56G G G. . .? ? ?C C C? ? ?8 8 8,  I I I2B B BE E E49 9 9 9 9r%   rK  c                   ,    e Zd Zd Zd Zd Zd Zd ZdS )
TZInfoBasec                    | j         } G d dt                    } |ddd |                      }|t          u rdpd}|                     |                                |           t          |t          u rd	pd
          }|                     |                                |           |                     |                                |           d S )Nc                       e Zd Zd Zd ZeZdS )7TZInfoBase.test_argument_passing.<locals>.introspectivec                     |rdpdS )Nrealnoner   rx   s     r#   r}   z>TZInfoBase.test_argument_passing.<locals>.introspective.tzname|  s    BM6,CV%Cr%   c                 *    t          |rdpd          S )Nrf   ri   r   rx   s     r#   rz   zATZInfoBase.test_argument_passing.<locals>.introspective.utcoffset}  s     29"+;<<<<r%   N)rK   rb   rc   r}   rz   r   r   r%   r#   introspectiver  {  s+        CCC= = =CCCr%   r  r&   rY   rU   r   r  r  r  rf   ri   )r=  r   r   r0   r}   r   rz   r   )r1   rZ  r  objr	  s        r#   test_argument_passingz TZInfoBase.test_argument_passingx  s    m	 	 	 	 	F 	 	 	 c!Q--//222$;)63Vx000cTk&9c&?RAAA(333H-----r%   c                 H   | j         }|                     t          |dddd            G d dt                    }|                     t          |ddd|            G d dt                    } |            } |ddd|          }|                     |j        |           d S )Nr&   r   r   c                       e Zd Zd Zd ZdS )3TZInfoBase.test_bad_tzinfo_classes.<locals>.NiceTryc                     d S r4   r   r7   s    r#   rs   z<TZInfoBase.test_bad_tzinfo_classes.<locals>.NiceTry.__init__        r%   c                     d S r4   r   rx   s     r#   rz   z=TZInfoBase.test_bad_tzinfo_classes.<locals>.NiceTry.utcoffset  r  r%   NrK   rb   rc   rs   rz   r   r%   r#   NiceTryr    "        $$$)))))r%   r  c                       e Zd Zd Zd ZdS )5TZInfoBase.test_bad_tzinfo_classes.<locals>.BetterTryc                     d S r4   r   r7   s    r#   rs   z>TZInfoBase.test_bad_tzinfo_classes.<locals>.BetterTry.__init__  r  r%   c                     d S r4   r   rx   s     r#   rz   z?TZInfoBase.test_bad_tzinfo_classes.<locals>.BetterTry.utcoffset  r  r%   Nr  r   r%   r#   	BetterTryr    r  r%   r  )r=  r   r   objectr   r5   )r1   rZ  r  r  ro  r   s         r#   test_bad_tzinfo_classesz"TZInfoBase.test_bad_tzinfo_classes  s    m)S!Q"===	* 	* 	* 	* 	*f 	* 	* 	* 	)S!Q'BBB	* 	* 	* 	* 	* 	* 	* 	* IKKC1a"""ah"""""r%   c                      G d dt                     }| j        }dD ]\  }}|t          u r |ddd ||                    }n$|t          u r |dddddd ||                    }|rt	          |          }t          |d	          \  }}d
|dk     rdpd||fz  }	t          |t                    r|                                }|                     t          |          d|	z              | 
                    t          t          |           d S )Nc                       e Zd Zd Zd ZdS )6TZInfoBase.test_utc_offset_out_of_bounds.<locals>.Edgyc                 0    t          |          | _        d S rh   r   rq   )r1   rq   s     r#   rs   z?TZInfoBase.test_utc_offset_out_of_bounds.<locals>.Edgy.__init__  s    '777r%   c                     | j         S r4   )rq   rx   s     r#   rz   z@TZInfoBase.test_utc_offset_out_of_bounds.<locals>.Edgy.utcoffset  s
    {"r%   Nr  r   r%   r#   Edgyr    s2        8 8 8# # # # #r%   r  ))`F)aT)  T)rb  Fr&   rY   rU   r   r]   rX  z%c%02d:%02dr   r  r  z01:02:03)r   r=  r   r   rk  r"  rk   timetzr0   r   r   r   )
r1   r  rZ  rq   legitr   aofsr  rm  tags
             r#   test_utc_offset_out_of_boundsz(TZInfoBase.test_utc_offset_out_of_bounds  sU   	# 	# 	# 	# 	#6 	# 	# 	# m- 	6 	6MFE d{{C1aV555C1aAqf>>>  66{{dB''1#vz'9c'@S!Q&GGa** #

A  Qc)9::::!!*c15555%	6 	6r%   c           	         | j         } G d dt                    } |ddd           |dddd            |ddd |                      fD ]w}|                     |                                           |                     |                                           |                     |                                           x G d dt                    } |ddd |                      }|                     |                                t          d                     |                     |                                t          d	                     |                     |                                d
            G d dt                    } |ddd |                      }|                     t          |j                   |                     t          |j                   |                     t          |j                    G d dt                    } |ddd |                      }|                     t          |j                   |                     t          |j                    G d dt                    } |ddd |                      }|                     |                                t          d                     |                     |                                t          d                     d S )Nc                        e Zd Zd Zd Zd ZdS )*TZInfoBase.test_tzinfo_classes.<locals>.C1c                     d S r4   r   rx   s     r#   rz   z4TZInfoBase.test_tzinfo_classes.<locals>.C1.utcoffset  r  r%   c                     d S r4   r   rx   s     r#   r   z.TZInfoBase.test_tzinfo_classes.<locals>.C1.dst  r  r%   c                     d S r4   r   rx   s     r#   r}   z1TZInfoBase.test_tzinfo_classes.<locals>.C1.tzname  s    r%   Nr   r   r%   r#   C1r    s+        000***-----r%   r  r&   r   c                        e Zd Zd Zd Zd ZdS )*TZInfoBase.test_tzinfo_classes.<locals>.C3c                 "    t          d          S )Nr  ri   r   rx   s     r#   rz   z4TZInfoBase.test_tzinfo_classes.<locals>.C3.utcoffset  s    Ie,D,D,D%Dr%   c                 "    t          d          S )Nr  ri   r   rx   s     r#   r   z.TZInfoBase.test_tzinfo_classes.<locals>.C3.dst  s    i&=&=&==r%   c                     dS Nanamer   rx   s     r#   r}   z1TZInfoBase.test_tzinfo_classes.<locals>.C3.tzname  s    r%   Nr   r   r%   r#   C3r    s+        DDD===00000r%   r  r  ri   r  r  c                        e Zd Zd Zd Zd ZdS )*TZInfoBase.test_tzinfo_classes.<locals>.C4c                     dS r  r   rx   s     r#   rz   z4TZInfoBase.test_tzinfo_classes.<locals>.C4.utcoffset  s    GGr%   c                     dS r  r   rx   s     r#   r   z.TZInfoBase.test_tzinfo_classes.<locals>.C4.dst  r  r%   c                     dS rZ  r   rx   s     r#   r}   z1TZInfoBase.test_tzinfo_classes.<locals>.C4.tzname  s    r%   Nr   r   r%   r#   C4r    s+        333'''*****r%   r  c                       e Zd Zd Zd ZdS )*TZInfoBase.test_tzinfo_classes.<locals>.C6c                 "    t          d          S )Nir   r   rx   s     r#   rz   z4TZInfoBase.test_tzinfo_classes.<locals>.C6.utcoffset  s    IC,@,@,@%@r%   c                 "    t          d          S )Nr/  r   r   rx   s     r#   r   z.TZInfoBase.test_tzinfo_classes.<locals>.C6.dst  s    ib&9&9&99r%   Nr  r   r%   r#   C6r    s"        @@@99999r%   r  c                       e Zd Zd Zd ZdS )*TZInfoBase.test_tzinfo_classes.<locals>.C7c                 "    t          d          S )Nr  r   r   rx   s     r#   rz   z4TZInfoBase.test_tzinfo_classes.<locals>.C7.utcoffset  s    I2,F,F,F%Fr%   c                 "    t          d          S )Nr   r   rx   s     r#   r   z.TZInfoBase.test_tzinfo_classes.<locals>.C7.dst  s    iS&A&A&AAr%   Nr  r   r%   r#   C7r    s"        FFFAAAAAr%   r  r  r   r  )r=  r   r  rz   r   r}   r0   r   r   r   r   )r1   rZ  r  r   r  r  r  r  s           r#   test_tzinfo_classeszTZInfoBase.test_tzinfo_classes  sP   m	. 	. 	. 	. 	. 	. 	. 	. #aA,,#aAd+++#aAbbdd+++- 	* 	*A akkmm,,,aeegg&&&ahhjj))))	1 	1 	1 	1 	1 	1 	1 	1 C1a%%%	%(@(@(@AAA)D"9"9"9:::W---	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ C1a%%%)Q[111)QU+++)QX...	: 	: 	: 	: 	: 	: 	: 	: C1a%%%*ak222*ae,,,	B 	B 	B 	B 	B 	B 	B 	B C1a%%%	r(B(B(BCCC)"="="=>>>>>r%   c                 Z   | j         } G d dt                    } |ddd |                      }|                    d          }|                    d          }|                    d	          }|||fD ]k}|||fD ]c}t          t          t
          t          t          t          fD ]:}	 |	||          }
 |	|j	        |j	                  }| 
                    |
|           ;dl|t          ur|                    d |            
          }|                    d |            
          }|                    d	 |            
          }|||fD ]Z}|||fD ]P}||k    ||k     z
  }
||u s||u r||u s||u rd}n||cxu r|u rn nd}n	||u rd}nd}| 
                    |
|           QYd S d S )Nc                       e Zd Zd ZdS )=TZInfoBase.test_aware_compare.<locals>.OperandDependentOffsetc                 b    |j         dk     rt          |j                   S t          d          S Nr'   ri   r   r  r   r  s     r#   rz   zGTZInfoBase.test_aware_compare.<locals>.OperandDependentOffset.utcoffset  3    8b==$QX6666 %R0000r%   Nr   r   r%   r#   OperandDependentOffsetr    #        1 1 1 1 1r%   r  r  r  r'   r   rU   r|  r   r  r   r   r  r&   )r=  r   r  r   r   r   r   r   r	   r  r0   r   )r1   rZ  r  r[  d0r  rp  r  rl  opr^  r	  s               r#   test_aware_comparezTZInfoBase.test_aware_compare  sO   m	1 	1 	1 	1 	1V 	1 	1 	1 s1a$:$:$<$<===\\\##\\\##\\\$$R 	4 	4ARZ 4 4b"b"b0 4 4B"Q((C!r!(AH55H$$S(333344 d??Q/E/E/G/GHHBQ/E/E/G/GHHBR0F0F0H0HIIBRZ 4 4R 4 4Aq5QU+CR177bAGG#$a2#$b#% $%$$S(33334 ?4 4r%   N)rK   rb   rc   r  r  r  r  r  r   r%   r#   r  r  v  s`        . . .$# # # 6 6 68.? .? .?`-4 -4 -4 -4 -4r%   r  c                   x    e Zd ZeZd Zd Zd Zd Zd Z	d Z
d Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd ZdS )
TestTimeTZc                 :   |                                  }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j                   d S rZ  )r=  r0   rf  r  r  rj  r  r   r  s     r#   
test_emptyzTestTimeTZ.test_empty  s    MMOO###1%%%1%%%***!(#####r%   c                    t          ddd          }t          ddd          }t          ddd	          }t          d
d|          }t          dd|          }t          dd|          }t          d          t          d|          |                     |j        |           |                     |j        |           |                     |j        |           |                     j                   |                     j        |           |                     |                                t          d                     |                     |                                t          d                     |                     |                                t          d                     |                                                                |                     t          |j        d           |                     |	                                d           |                     |	                                d           |                     |	                                d           |                     	                                           |                     t          |j	        d           |                     |
                                t          d                     |                     |
                                t          d                     |                     |
                                t          d	                     |                     
                                           |                     t          |j
        d           |                     t          |          t          |                     |                     t          |          t          |                     |                     t          |          t          |                     |                     ||           |                     ||           |                     ||           |                                |                     t          fd           |                     t          fd           |                     t          |          d           |                     t          |          d           |                     t          |          d           |                     t                    d           |                     t                    d           |                     |                                d           |                     |                                d           |                     |                                d           |                                                     d           |                                                     d           d}|                     t          |          |dz              |                     t          |          |dz              |                     t          |          |dz              |                     t                    |dz              |                     t                    |d z              |                     |                    d!          d"           |                     |                    d#          d$           |                     |                    d#          d%           t          d&d'          }t          d(d)|          }|                     |                    d*          d+            G d, d-t                    }	t          d.d	d/ |	                      }
|                     |
                    d0          d1           |                     t          |
j        d2           d3| j        j        v r*d4|	_        |                     t(          |
j        d2           d S d S )5Nr   r   r&   r   r   rW   rX  METrU   rX   r  r   r   r  (   rv  r  ri   zno argsc                       k     S r4   r   r  t5s   r#   rE  z'TestTimeTZ.test_zones.<locals>.<lambda>L  rF  r%   c                       k     S r4   r   r  s   r#   rE  z'TestTimeTZ.test_zones.<locals>.<lambda>M  rF  r%   z07:47:00-05:00z12:47:00+00:00z13:47:00+01:00z00:00:00.000040z00:00:00.000040+00:00zdatetime.timez(7, 47, tzinfo=est)z(12, 47, tzinfo=utc)z(13, 47, tzinfo=met)z(0, 0, 0, 40)z(0, 0, 0, 40, tzinfo=utc)z%H:%M:%S %%Z=%Z %%z=%zz07:47:00 %Z=EST %z=-0500z%H:%M:%S %Z %zz12:47:00 UTC +0000z13:47:00 MET +0100r  z%z %Z %%z%%Zr   r   z%H:%M %%Z='%Z' %%z='%z'z"23:59 %Z='%z %Z %%z%%Z' %z='-2359'c                       e Zd ZdZd ZdS )(TestTimeTZ.test_zones.<locals>.Badtznamerf   c                     | j         S r4   r  rx   s     r#   r}   z/TestTimeTZ.test_zones.<locals>.Badtzname.tznameo  s    .r%   N)rK   rb   rc   r   r}   r   r%   r#   	Badtznamer  m  s        B00000r%   r  rY   r[   z%H:%M:%Sz02:03:04r6  rR   r  )re   r   r0   r   r  rz   r   r   r   r}   r   r  r   r   r  r   r  rJ   rK   r   r   )r1   estr6   metr  r  r  r  yuckr  r   r  r  s              @@r#   
test_zoneszTestTimeTZ.test_zones"  s[   $q))!UB''"eQ''1b%%%"b%%%"b%%%b!!!b---C(((C(((C(((")$$$C(((4)@)@)@AAA1)=)=)=>>>2)>)>)>???",,..))))R\9===e,,,e,,,e,,,"))++&&&)RY	:::9Q#7#7#78889R#8#8#89999Q#7#7#7888"&&((###)RVY777b488,,,b488,,,b488,,,R   R   R   B###)_____555)_____555R"2333R"2333R"2333R"3444R"9:::)9:::)9:::)9:::):;;;)@AAAb1'<#<===b1'=#=>>>b1'=#=>>>b1#6777b1'B#BCCC%=>>%?	A 	A 	A%5668LMMM%5668LMMM5.11"b&&&%>??%I	K 	K 	K	1 	1 	1 	1 	1 	1 	1 	1 Aq---J//<<<)QZ666 dn---#ILj!*d;;;;; .-r%   c           
         |                      ddddt          dd                    }|                      ddddt          dd                    }|                     t          |          t          |                     |                      d	d
ddt          dd                    }|                      d	dddt          dd                    }|                     t          |          t          |                     d S )Nr   r&   rY   rU   r  r  r   i  r   r  r]   r  irO  i)r=  re   r0   r  r  s      r#   test_hash_edge_caseszTestTimeTZ.test_hash_edge_casesy  s    ]]1aAk$.C.C]DD]]1aAk$.C.C]DDb488,,,]]2r1c+eR2H2H]II]]2r1c+eR2H2H]IIb488,,,,,r%   c                    d} | j         | }t          D ]G\  }}}|                    ||          }|                    |          }|                     ||           H|                     |                                |                    d                     t          dd          }|                      ddd|          }t          D ]\  }}}|                    ||          }|                    |          }|                     ||           |                     |j	        t                     |                     |
                                t          d	                     |                     |                                d           |                     |                                |                    d                     d S )
Nrt  rY   r   r   rV   r]   rX   r   ri   )r=  r   r   r   r0   r*  r+  r   r   r   rz   r   r}   	r1   r   r   r   r   r"   r   r   tinfos	            r#   r  zTestTimeTZ.test_pickling  s    t}d#)7 	, 	,%GYMM$..Eooe,,GT7++++**D,>,>q,A,ABBB %T844}}Q1U}33)7 	9 	9%GYMM$..Eooe,,GT7+++!!'.2FGGGW..00)D2I2I2IJJJW^^--x8888**D,>,>q,A,ABBBBBr%   c           	         g d}t          dd          }|                     dddd|          }|D ]}t          D ]} ||d	
          }|                     ||t	          |                     |                     |j        t                      |                     |                                t          d                     |                     |	                                d           d S )N)s   cdatetime
time
(S'\x05\x06\x07\x01\xe2@'
ctest.datetimetester
PicklableFixedOffset
(tR(dS'_FixedOffset__offset'
cdatetime
timedelta
(I-1
I68400
I0
tRsS'_FixedOffset__dstoffset'
NsS'_FixedOffset__name'
S'cookie'
sbtR.s   cdatetime
time
(U@ctest.datetimetester
PicklableFixedOffset
)R}(U_FixedOffset__offsetcdatetime
timedelta
(JJ0 K tRU_FixedOffset__dstoffsetNU_FixedOffset__nameUcookieubtR.s   cdatetime
time
U@ctest.datetimetester
PicklableFixedOffset
)R}(U_FixedOffset__offsetcdatetime
timedelta
JJ0 K RU_FixedOffset__dstoffsetNU_FixedOffset__nameUcookieubR.r   r   rV   r]   rX   rg  r   r/  r0  ri   )
r   r=  r3  r0   r   r   r   rz   r   r}   )r1   r  r   r	  r5  r   r   s          r#   r6  zTestTimeTZ.test_compat_unpickle  s   
 
 
. %T844==Aq&=?? 	= 	=D% = =%x888  (DJJ???%%gn6JKKK  !2!2!4!4i6M6M6MNNN  !1!18<<<<=	= 	=r%   c                    | j         } |dt          dd                    }|                     |            |dt          dd                    }|                     |            |dt          dd                    }|                     |            |ddt          d	d                    }|                     |           d S )
Nr   r   r  r   rV   i,  r   r   r  )r=  re   r   )r1   rZ  r   s      r#   test_more_boolzTestTimeTZ.test_more_bool  s    mC+dB//000C+dB//000C+c2..///CB{:r::;;;r%   c                 2   | j         }t          dd          }t          t          d          d          }dddd	|g} || }|                     ||                                           d
}ddddd|ffD ]C\  }}|d d          }	||	|<    ||	 }
 |j        di ||i}|                     |
|           |dz  }D|                     |                                d           |                    d           }|                     |j                   |                     |                                           |                    |          }|                     ||           |                     |j        |j                    |d          }| 	                    t          |j        d           | 	                    t          |j        d           | 	                    t          |j        d           | 	                    t          |j        d           d S )Nr  +1008ri   -200r&   rY   rU   r[   r   r  r  r  r  r   r   r/  r{  r  r|  rf  r  rv  r   r=  re   r   r0   r  r}   r  r   r5   r   r   r1   rZ  z100zm200r   r[  rr  rF   r\  r]  r	  r^  base2base3s                 r#   r_  zTestTimeTZ.test_replace  s)   m3''Id333V<<1aD!sDzt||~~...(**/&.	0 
	 
	LD&
 111gGGAJsG}H$,00$00CXs+++FAA 	///D))%,'''%,,..))) T**u%%%dk5<000 s1vv*dl<<<*dl2>>>*dl3???*dlHHHHHr%   c                    |                      ddd          }|                      ddd          }|                     ||           |                    d           }|                     ||           |                    t          d d                    }|                     ||           |                    t          dd                    }|                     ||            G d dt
                    } |            }|                    |          }|                    |          }|                     |                                t          d	
                     |                     |                                t          d
                     |                     ||           |                     |                      }|                     ||k                d S )Nr&   rY   rU   r   r  r   c                       e Zd Zd Zd ZdS )-TestTimeTZ.test_mixed_compare.<locals>.Variesc                 0    t          d          | _        d S Nr  ri   r  r7   s    r#   rs   z6TestTimeTZ.test_mixed_compare.<locals>.Varies.__init__      '333r%   c                 L    | xj         t          d          z  c_         | j         S Nr&   ri   rq   r   r  s     r#   rz   z7TestTimeTZ.test_mixed_compare.<locals>.Varies.utcoffset  %    y3333{"r%   Nr  r   r%   r#   Variesr    2        4 4 4# # # # #r%   r  r   ri   r/  )	r=  r0   r  re   r   r   rz   r   r   r1   r  r  r  vs        r#   rK  zTestTimeTZ.test_mixed_compare  s   ]]1a##]]1a##R   ZZtZ$$R   ZZ{444Z55R   ZZ{1b11Z22B###	# 	# 	# 	# 	#V 	# 	# 	# FHHZZqZ!!ZZqZ!!2)>)>)>???2)>)>)>???R    ZZvvxxZ((R     r%   c           	         ddg}d}d}d}d}|t          t          j        ||||                    z  }d t          j        t          t          d                    t          t          d	d
                    g}|D ]}|D ]} | j        |d|i}	|	                                }
|                     |
          5  | j        	                    |
          }| 
                    |	|           d d d            n# 1 swxY w Y   d S )Nr  )r   r   r   r(  )r  r   r<  )rV   r  )r[   r  )r   i r!  rY   r   r]   r.  r   r   r	  )r  	itertoolsproductr   r6   r   r=  r  r3  r  r0   )r1   time_exampleshhmmssusecr  ttupr  r   r
  t_rts               r#   r  zTestTimeTZ.test_fromisoformat  sk    

 "i/BDAABBBIA...//IAr:::;;= " 	. 	.D . .!DM4444{{}}\\t\,, . .=66t<<D$$Q---. . . . . . . . . . . . . . .	.	. 	.s   :1C77C;>C;c           
      Z   |                      dddd          }t          d          t          d          t          dd	
          t          ddd          t          dddd          g}|d |D             z  }d t          j        t          t          d                    g}|d |D             z  }|D ]t}|                    |          }|                                }|                     |          5  | j                             |          }d d d            n# 1 swxY w Y   ud S )Nr   r  r  r  rV   r   rY   r]   r.  r   r   r'  r[   r  rg  r)  c                     g | ]}d |z  S r  r   r  s     r#   r$   z:TestTimeTZ.test_fromisoformat_timezone.<locals>.<listcomp>4  r  r%   r   c                 ,    g | ]}t          |          S r   r   r  s     r#   r$   z:TestTimeTZ.test_fromisoformat_timezone.<locals>.<listcomp>9  r  r%   r   r	  r  )r1   	base_timer  r  r  r   r
  r%  s           r#   r  z&TestTimeTZ.test_fromisoformat_timezone*  s   MM"b"f55	 A	 2 2 2Ar***BB777Aq!&III	
	 	22	2222	IA...//1 	5595555 	' 	'C!!!--A;;==D4(( ' '}22488' ' ' ' ' ' ' ' ' ' ' ' ' ' '		' 	's   8DD#	&D#	c           
      v   ddg}d t           j        t          t          d                    t          t          d                    t          t          dd                    g}g d	}t          |          D ]\  }}|D ]}|D ]}|d
k    rd|d         dz  z  }|dd         |fz   } | j        |dd|z            d|i}	|	                    |          }
|                     |
          5  | j                            |
          }|                     |	|           d d d            n# 1 swxY w Y   d S )N)r  r<  r  rg  )r  r<  r  r   r  r   rY   r]   r.  r   r  rU  rY  r  r   r&   r   r  r	  r  )r1   
time_basesr  r  r  r  r  t_tupler  r   r
  r%  s               r#   r  z'TestTimeTZ.test_fromisoformat_timespecsC  s   


 IB///00IA...//IAr:::;;=
5 5 5	  	** 	2 	2FB 
2 
2) 	2 	2G^+++/72;$3F+G(")!B$-3C2E"E%1r6
(;ISIIA;;;33D400 2 2#}::4@@((D1112 2 2 2 2 2 2 2 2 2 2 2 2 2 2	2
2	2 	2r  c                     g d}|D ]?\  }} | j         | }| j                             |          }|                     ||           @d S )N))z
12:30:45.1)r   r  r  r_  )z12:30:45.12)r   r  r  i )z12:30:45.123)r   r  r  ix )z12:30:45.1234)r   r  r  i )z12:30:45.12345)r   r  r  i: )z12:30:45.123456r   r  r  rg  )z12:30:45.1234567r.  )z12:30:45.12345678r.  )r=  r  r0   )r1   strstime_str
time_compsr	  r  s         r#   test_fromisoformat_fractionsz'TestTimeTZ.test_fromisoformat_fractions^  so    	
 	
 	
 %) 	/ 	/ Hj$t}j1H]00::FVX....		/ 	/r%   c                 	   g d|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd	|                      dd          fd
|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      dd          fd|                      ddd          fd|                      ddd          fd|                      dddd          fd|                      dddd          fd |                      dddd!          fd"|                      dddd!          fd#|                      dddd$          fd%|                      dddd$          fd&|                      ddt          j        '          fd(|                      ddt          j        '          fd)|                      ddt          j        '          fd*|                      ddt          t          d+,                    '          fd-|                      ddt          t          d+d./                    '          fd0|                      ddt          t          d1,                    '          fd2|                      ddt          t          d1,                    '          fd3|                      ddt          t          dddd$4                     '          f}|D ]c\  }}|                     |5          5  | j                             |          }|                     ||           d d d            n# 1 swxY w Y   dd S )6N0000r   z00:00000000r^  z000000.0z
00:00:00.0z
000000.000z00:00:00.000z000000.000000z00:00:00.0000001200r   z12:00120000z12:00:00z120000.0z
12:00:00.0z
120000.000z12:00:00.000z120000.000000z12:00:00.0000002359r   r   z23:59235959z23:59:59z235959.9i z
23:59:59.9z
235959.999r^  z23:59:59.999z235959.999999r(  z23:59:59.999999z	00:00:00Zr   z12:00:00+0000z12:00:00+00:00z00:00:00+05rV   r   z00:00:00+05:30r  r   z12:00:00-05:00r  z12:00:00-0500z00:00:00,000-23:59:59.999999r)  r  )r=  r   r6   r   r3  r  r0   r  s        r#    test_fromisoformat_time_examplesz+TestTimeTZ.test_fromisoformat_time_examplesp  s   ,
T]]1a((),
dmmAq))*,
 t}}Q**+,
 q!,,-	,

 q!,,-,
 4==A../,
 4==A../,
 T]]1a001,
 dmmAq112,
 a 3 34,
 T]]2q))*,
 dmmB**+,
 t}}R++,,
 r1--.,
 r1--.,
  4==Q//0!,
" 4==Q//0#,
$ T]]2q112%,
& dmmB223',
( b! 4 45),
* T]]2r**++,
, dmmB++,-,
. t}}RR001/,
0 r2r2231,
2 r2r6::;3,
4 4==RV<<=5,
6 4==RV<<=7,
8 T]]2r2v>>?9,
: dmmBB??@;,
< b"b& A AB=,
> $--1X\-BBC?,
@ dmmB(,mGGHA,
B t}}R8<}HHIC,
D ]]1a1C1C1C(D(D]EEGE,
H ]]1aB1O1O1O(P(P]QQSI,
L ]]2q)"2E2E2E)F)F]GGIM,
P ]]2q)"2E2E2E)F)F]GGIQ,
T ,]]1a)"bZ\kq2r2r2r1r(s(s]ttvU,
\ $, 	3 	3Ix	22 3 344Y??  2223 3 3 3 3 3 3 3 3 3 3 3 3 3 3	3 	3s   81R55R9	<R9	c                    g d}|D ]|}|                      |          5  |                     t                    5  | j                            |           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   }d S )N)r  u   1200z12:z12:30:z	12:30:15.1z12:3z12:30:1z1a:30:45.334034z12:a0:45.334034z12:30:a5.334034z12:30:45.123456+24:30z12:30:45.123456-24:30u   12：30：4512:30:45.123456az12:30:45.123456789au   12:30:45․123456z	12:30:45az12:30:45.123ar=  z12:30:45.123456-z12:30:45.123456+z12:30:45.123456+12:00:30ar3  r4  r  s      r#   r  z#TestTimeTZ.test_fromisoformat_fails  s   
 
 
4   	9 	9Gg.. 9 9&&z22 9 9M//8889 9 9 9 9 9 9 9 9 9 9 9 9 9 99 9 9 9 9 9 9 9 9 9 9 9 9 9 9	9 	9r6  c                     dd t          j        d          g}|D ]N}|                     t                    5  | j                            |           d d d            n# 1 swxY w Y   Od S )Ns   12:30:45z12:30:45r  r  s      r#   r  z-TestTimeTZ.test_fromisoformat_fails_typeerror  s     $J(?(?@	! 	6 	6H""9-- 6 6++H5556 6 6 6 6 6 6 6 6 6 6 6 6 6 6	6 	6r  c                     G d d| j                   } |ddddt          j                  }|                    |                                          }|                     ||           |                     ||           d S )Nc                       e Zd ZdS )<TestTimeTZ.test_fromisoformat_subclass.<locals>.TimeSubclassNr  r   r%   r#   r  rA    r  r%   r  r   rd  r  i r   )r=  r   r6   r  r  r0   r   )r1   r  tsctsc_rts       r#   r  z&TestTimeTZ.test_fromisoformat_subclass  s    	 	 	 	 	4= 	 	 	 l2r2vhlCCC++CMMOO<<f%%%fl33333r%   c           	           G  fdd j                   }ddddt          ddd	          f}  j         | } ||i d
di}                     |j        |                                |j        d                                |j        d                                |                                |                                                                |                    d          |j        |j	        z   dz
             d S )Nc                   $    e Zd ZdZ fdZd ZdS )*TestTimeTZ.test_subclass_timetz.<locals>.Crf   c                     |                                 }|                    d          } j        j        | g|R i |}||_        |S rj  rk  rm  s         r#   r   z2TestTimeTZ.test_subclass_timetz.<locals>.C.__new__  rq  r%   c                 &    || j         z   | j        z   S r4   r  rs  s     r#   ru  z2TestTimeTZ.test_subclass_timetz.<locals>.C.newmeth  r  r%   Nrv  r7   s   r#   rx  rF    r  r%   rx  r[   rV   r]     r   r   r&   r   rX   rf   rZ   )
r=  re   r0   rJ   rw  r   rz   ru  rf  r  rz  s   `    r#   test_subclass_timetzzTestTimeTZ.test_subclass_timetz  s   	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 !Q[ua888dmT"a&'1&&***+++A&&&#--//:::R#(SZ*?!*CDDDDDr%   N)rK   rb   rc   r   r=  r  r  r  r  r6  r  r_  rK  r  r  r  r2  r:  r  r  r  rJ  r   r%   r#   r  r    s+       H$ $ $U< U< U<n- - -C C C, =  =  =D   %I %I %IN! ! !<. . .4' ' '22 2 26/ / /$23 23 23h9 9 9@6 6 64 4 4E E E E Er%   r  c                   &   e Zd ZeZd Zd Zd Zd Zd Z	d Z
d Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Z ej        d          d             Z ej        d          d             Z ej        d          d             Zd Zd Zd ZdS )TestDateTimeTZc           	         |                      ddddddd          }|                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j        d           |                     |j	        d            d S )Nr&   rY   rU   r[   rV   r]   rX   )
r=  r0   r_  r`  r  rf  r  r  rj  r   rx   s     r#   test_trivialzTestDateTimeTZ.test_trivial  s    ]]1aAq!Q//!$$$1%%%###!$$$A&&&A&&&+++D)))))r%   c                 x   |                      dddt          dd                    |                      t          dddddd	t          d
d                    |                     k                |                     k               |                     k               |                                |                                |                      dddddt          dd                    |                      dddddt          dd                    |                                |                      dddddt          dd                    |                     k               |                      dddddt          dd                    |                     k                |                      dddddt          dd          d          |                     k               |                      dddddt          dd          d          |                     k               | j         j        |                                |                                |                     t                    5  k     d d d            n# 1 swxY w Y    G d dt                    }|                      ddd |                      |                                |                                |                      ddd          |                                 G d dt                    }|                      ddd |                      |                      dddt          dd                    |                     t          fd           d S )Nr&   r  r  r   r   r  r   r   r(  r  rY   rU   r     r   )r   r  rm  c                       e Zd Zd ZdS )4TestDateTimeTZ.test_even_more_compare.<locals>.Naivec                     d S r4   r   rx   s     r#   rz   z>TestDateTimeTZ.test_even_more_compare.<locals>.Naive.utcoffset4  r  r%   Nr   r   r%   r#   NaiverR  3  s        00000r%   rT  rV   r]   rX   c                       e Zd Zd ZdS )4TestDateTimeTZ.test_even_more_compare.<locals>.Bogusc                 "    t          d          S )Nrb  ri   r   rx   s     r#   rz   z>TestDateTimeTZ.test_even_more_compare.<locals>.Bogus.utcoffset@  s     ....r%   Nr   r   r%   r#   r  rV  ?  s#        / / / / /r%   r  c                       k    S r4   r   )r  r  s   r#   rE  z7TestDateTimeTZ.test_even_more_compare.<locals>.<lambda>D  s    bBh r%   )r=  re   r   r   r0   r   r   r   r   r   r   )r1   rT  r  r  r  s      @@r#   test_even_more_comparez%TestDateTimeTZ.test_even_more_compare  s%   
 ]]1a;tR+@+@]AA]]7BBB"-eR"8"8  : : 	R   b!!!R   R   R    ]]1b"b"[B5G5G]HH]]1aAr+i2L2L]MMR    ]]1b"b"[B5G5G]HHR    ]]1b"b"[B5G5G]HHR    ]]1b"b"[B5G5G"#  % %R    ]]1b"b"[B5G5G'(  * *R    ]B###R   y)) 	 	GG	 	 	 	 	 	 	 	 	 	 	 	 	 	 		1 	1 	1 	1 	1F 	1 	1 	1]]1a5577]33B###R    ]]1a##R   	/ 	/ 	/ 	/ 	/F 	/ 	/ 	/ ]]1a5577]33]]1a;q"+=+=]>>*&6&6&6&6&677777s   J((J,/J,c           
         d} | j         | }t          D ]G\  }}}|                    ||          }|                    |          }|                     ||           H|                     |                                |                    d                     t          dd          } | j         |i d|i}|                      dddt          ddd          	          }t          D ]\  }}}|                    ||          }|                    |          }|                     ||           | 	                    |j
        t                     |                     |                                t          d
                     |                     |                                d           |                     |                                |                    d                     d S )NrL  rY   r   r   r   r&   r   r  r   ri   )r=  r   r   r   r0   r*  r+  r   re   r   r   rz   r   r}   r  s	            r#   r  zTestDateTimeTZ.test_picklingF  s   )t}d#)7 	, 	,%GYMM$..Eooe,,GT7++++**D,>,>q,A,ABBB %T844t}d8x&788--1aAr10E0E-FF)7 	9 	9%GYMM$..Eooe,,GT7+++!!'.2FGGGW..00)D2I2I2IJJJW^^--x8888**D,>,>q,A,ABBBBBr%   c                    g d}d}t          dd          } | j        |i d|i}|D ]}t          D ]} ||d          }|                     ||           |                     |j        t                      |                     |                                t          d                     |                     |                                d           d S )	N)s   cdatetime
datetime
(S'\x07\xdf\x0b\x1b\x14;\x01\x01\xe2@'
ctest.datetimetester
PicklableFixedOffset
(tR(dS'_FixedOffset__offset'
cdatetime
timedelta
(I-1
I68400
I0
tRsS'_FixedOffset__dstoffset'
NsS'_FixedOffset__name'
S'cookie'
sbtR.s   cdatetime
datetime
(U
;@ctest.datetimetester
PicklableFixedOffset
)R}(U_FixedOffset__offsetcdatetime
timedelta
(JJ0 K tRU_FixedOffset__dstoffsetNU_FixedOffset__nameUcookieubtR.s   cdatetime
datetime
U
;@ctest.datetimetester
PicklableFixedOffset
)R}(U_FixedOffset__offsetcdatetime
timedelta
JJ0 K RU_FixedOffset__dstoffsetNU_FixedOffset__nameUcookieubR.)r-  r   r.  r<  r   r&   rg  r   r   r   r/  r0  ri   )	r   r=  r3  r0   r   r   rz   r   r}   )r1   r  r   r   r	  r5  r   r   s           r#   r6  z#TestDateTimeTZ.test_compat_unpickle]  s   
 
 
2 /$T844 4=$<8U*;<< 	= 	=D% = =%x888  (333%%gn6JKKK  !2!2!4!4i6M6M6MNNN  !1!18<<<<=	= 	=r%   c                    |                      dddt          dd                    }t          |           |                      t          dddddd	t          d
d                    }t          |           |                      dddt          dd                    }|                     t
          t          |           d S )Nr&   r  r  r   r   r  r   r   r(  r  rV   r  )r=  re   r  r   r   r   r  s     r#   test_extreme_hashesz"TestDateTimeTZ.test_extreme_hashes  s     MM!Q+dB*?*?M@@QMM'2r2r2v!,UB!7!7  9 9Q MM!Q+eR*@*@MAA*dA.....r%   c                    t          dd          }t          dd          }t          dd          }t          ddd	d
d|          }t          ddd	dd|          }t          ddd	dd|          }|                     |j        |           |                     |j        |           |                     |j        |           |                     |                                t          d                     |                     |                                t          d                     |                     |                                t          d                     |                     |                                d           |                     |                                d           |                     |                                d           |                     t          |          t          |                     |                     t          |          t          |                     |                     t          |          t          |                     |                     ||           |                     ||           |                     ||           |                     t          |          d           |                     t          |          d           |                     t          |          d           d}|                     t          |          |dz              |                     t          |          |dz              |                     t          |          |dz              d S )Nr   r   r   r   rX  r  r^  rU   r  rX   r  r   r   r  ri   z2002-03-19 07:47:00-05:00z2002-03-19 12:47:00+00:00z2002-03-19 13:47:00+01:00zdatetime.datetime(2002, 3, 19, z7, 47, tzinfo=est)z12, 47, tzinfo=utc)z13, 47, tzinfo=met))
re   r   r0   r   rz   r   r}   r  r   r   )r1   r  r6   r  r  r  r  r  s           r#   r  zTestDateTimeTZ.test_zones  s
   $&&!U##"e$$dArAr#666dAr2r#666dAr2r#666C(((C(((C(((4)@)@)@AAA1)=)=)=>>>2)>)>)>???e,,,e,,,e,,,b488,,,b488,,,b488,,,R   R   R   R"=>>>R"=>>>R"=>>>-b1';#;<<<b1'<#<===b1'<#<=====r%   c                     t          dd          }t          ddd          }t          dddd|	          }t          j        ||          }|                     |t          ddddddd|	                     d S 
NrX  r  r^  rU   r[   r(  r  r  r   )re   r   r   r   r  r0   )r1   r  r  r   ry   s        r#   r  zTestDateTimeTZ.test_combine  s    "e$$q!"b!T#...a$$XdAq"b!T/24 4 4 	5 	5 	5 	5 	5r%   c           
         t          dd          }|                     ddddddd|	          }|                     |                                t          ddd                     |                     |                                t	          dddd                     |                     |                                t	          dddd|	                     d S r`  )re   r=  r0   r   r   r  )r1   r  ry   s      r#   r  zTestDateTimeTZ.test_extract  s    "e$$]]4Ar2q$s]CCDq!$4$4555DRD$9$9:::d2r1d3&G&G&GHHHHHr%   c                 z   | j                                         t          dd          }                                                    |          }| j                                                             |          |                     j        |           | 	                    
                                |           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           | 	                    z
  t          d	                     | 	                    z
  t          d	                     t          d
dd          z   |                     j        |           z   }|                     |j        |           | 	                    |           z
  }|                     |j        |           | 	                    |           |                     t          fd           | 	                    z
             t          t          j        dd          d          }                    |          |                     j        |           z
  }                                                                z
  z
  }| 	                    ||           |                      d
d
d
t          dd                    }|                      t"          ddddddt          dd                    }	|	|z
  }
| 	                    |
| j         j        | j         j        z
  t          d          z              t)          t*          d          }t)          t*          d          }|                    |          |	                    |          z
  | 	                    | j         j        | j         j        z
             d S )Niz	west 5:30r   c                       z
  S r4   r   r   nowawares   r#   rE  z9TestDateTimeTZ.test_tz_aware_arithmetic.<locals>.<lambda>      S8^ r%   c                       z
  S r4   r   rd  s   r#   rE  z9TestDateTimeTZ.test_tz_aware_arithmetic.<locals>.<lambda>      X^ r%   c                       z   S r4   r   rd  s   r#   rE  z9TestDateTimeTZ.test_tz_aware_arithmetic.<locals>.<lambda>  rf  r%   c                       z   S r4   r   rd  s   r#   rE  z9TestDateTimeTZ.test_tz_aware_arithmetic.<locals>.<lambda>  rh  r%   c                        z   S r4   r   )re  s   r#   rE  z9TestDateTimeTZ.test_tz_aware_arithmetic.<locals>.<lambda>  s    X-@ r%   r   r&   r   i.  )rS  rj   r   c                       z
  S r4   r   )r,  nowawarepluss   r#   rE  z9TestDateTimeTZ.test_tz_aware_arithmetic.<locals>.<lambda>  s    U\-A r%   r  rb  randomtimezoner  r   r  r   r   r(  r   i>  ri   r  r  )r=  r   re   r   r  r  r   r5   r   r0   r  r   r   r   r   	randrangerz   r   r   r   r   r  )r1   tz55	timeawarenowawareplus2r  tzrr^  r	  r   r   maxdifftzatzbr,  r   re  rm  s                @@@@r#   test_tz_aware_arithmeticz'TestDateTimeTZ.test_tz_aware_arithmetic  s   m!!4--HHJJ&&d&33	=((Y??hot,,,**I666 	)%;%;%;%;%;<<<)%;%;%;%;%;<<< 	)%;%;%;%;%;<<<)%;%;%;%;%;<<<)%@%@%@%@AAA 	sIaLL111H,ill;;; 2DAAA%'hot,,,(m*D111}555 e#dk4(((4((()%A%A%A%A%ABBB0%888 &*5$779IJJ#++3+77l)3///%  ))++h.@.@.B.BBUJh''' mmAq!Ke,D,DmEEmmGRRR#.ue#<#<  > >)$-"3dm6G"G"+F";";";#< 	= 	= 	= tS!!tS!!3''#++S+*A*AA 1DM4E EFFFFFr%   c                 (   | j         j        } |            }t          dd          } ||          } ||          }|                     |j        |j                   |                     |                                t          d                     |                     t          |d           |                     t          |d           |                     t          ||           |                     t          |||           t          dd	d          }t          t          d
d          dd          t          t          d
d          d          fD ]}t          d          D ]}t          j        |          }	|                     |	j        |           t          j                                        |          }
|
                    |          }t!          |	|z
            t          d          k     r n|                     d           d S )Nrf   42r  ri   r  r   r   r   r6   r  r  r   weirdtzrU   r  r   z0utcnow(), now(tz), or astimezone() may be broken)r=  r   re   r5   r   r0   rz   r   r   r   r   rl  r   r  r  r  rk  fail)r1   methr[  off42anotheragainr6   r{  r  r   r  now2s               r#   test_tzinfo_nowzTestDateTimeTZ.test_tzinfo_now  s   } tvvB%%$u++gnel333**,,i.C.C.CDDD)T2...)T"555)T777)T5%888
 !UA&&#IB$C$C$CYPQRR R!@!@!@)LLO 	N 	NGq N Nl7++cj'222!**22#2>>((11sTz??Yr%:%:%:::E ; 		LMMM	N 	Nr%   c                 t   dd l }| j        j        } |j                     } ||          }t          dd          } |||          } |||          }|                     |j        |j                   |                     |                                t          d                     | 	                    t          ||d           | 	                    t          ||d           | 	                    t          |||           | 	                    t          ||||           | 	                    t          |           d	}t          j        |          }	t          d
d          }
t          |
dd          }|	|
z   }t          j        ||          }|                     ||                    d                      d S )Nr   rf   ry  r  ri   r  r   rz  r  i'   r   r   )r   r=  r  re   r5   r   r0   rz   r   r   r   r   r_  r  )r1   r   r}  r  r[  r~  r  r  r  utcdatetimerz   r   r	  r^  s                 r#   test_tzinfo_fromtimestampz(TestDateTimeTZ.test_tzinfo_fromtimestamp#  s   }*TY[[tBxxB%%$r5//RE"""gnel333**,,i.C.C.CDDD)T2r222)T2b999)T2U;;;)T2ue<<<)T*** 	/	::
 C444	D!,,*$Y333;;d;#;#;<<<<<r%   c                     | j         j        } |            }t          dd          }|                     t          ||           |                     t          ||           d S )Nrf   ry  r   )r=  r  re   r   r   )r1   r}  r[  r~  s       r#   test_tzinfo_utcnowz!TestDateTimeTZ.test_tzinfo_utcnowF  sa    }#tvv B%%)T5111)T%88888r%   c                     dd l }| j        j        } |j                     } ||          }t          dd          }|                     t
          |||           |                     t
          |||           d S )Nr   rf   ry  r   )r   r=  r_  re   r   r   )r1   r   r}  r  r[  r~  s         r#   test_tzinfo_utcfromtimestampz+TestDateTimeTZ.test_tzinfo_utcfromtimestampP  s}    }-TY[[tBxx B%%)T2u555)T2e<<<<<r%   c                     G d dt                     }| j        }dD ])\  }} |ddddddd ||          	          }|                                }|                     d|j                   |                     d|j                   |                     d|j                   |                     d|j                   |                     d|j                   |                     d|j	                   |                     d
|j
                   |                     d|j                   |                     ||j                   +|                     t           |ddd |d          	          j                   |                      |ddd |d          	                                          j        d           |                      |ddd |d          	                                          j        d           |                     t           |ddd |d          	          j                   |                     t           |ddd |d          	          j                   d S )Nc                       e Zd Zd Zd ZdS )1TestDateTimeTZ.test_tzinfo_timetuple.<locals>.DSTc                 ^    t          |t                    rt          |          }|| _        d S rh   rk   rl   r   dstvaluer1   r  s     r#   rs   z:TestDateTimeTZ.test_tzinfo_timetuple.<locals>.DST.__init__`  /    h,, ;(:::H (r%   c                     | j         S r4   r  rx   s     r#   r   z5TestDateTimeTZ.test_tzinfo_timetuple.<locals>.DST.dstd  
    }$r%   NrK   rb   rc   rs   r   r   r%   r#   DSTr  _  s2        ) ) )% % % % %r%   r  ))r&   )r  r&   )r   r   )Nr  r&   r'   r<  r  r  r   r   r  r  r  rb  r  )r   r=  r  r0   r  r  r  r   r!  r"  r#  r$  r%  r   r   r   )r1   r  rZ  r  flagr  r   s          r#   test_tzinfo_timetuplez$TestDateTimeTZ.test_tzinfo_timetuple\  s   	% 	% 	% 	% 	%& 	% 	% 	% mC 	/ 	/NHdAq!RRCCMMBBBAAQ	***Q)))Q	***R+++R***R***Q	***Q	***T1:.... 	)SSAqS%B%B%B%LMMM 	Qq33t99555??AAJANNNQq33u::666@@BBKQOOO 	*cc!AaD		&B&B&B&LMMM*cc!AaE

&C&C&C&MNNNNNr%   c                 
    G d dt                     | j        }|                     t           |ddd d                    j                    G fdd          }dD ]} |dd	d
dddd |d|                    }|                                }|                     |j        |j                   |                     |j	        |j
                   |                     |j        |j                   |                     d|j                   |                     d|j                   |                     |j        |j                   |                     |                                |j                   |                     |                                t)          ddd                                          z
  dz   |j                   |                     d|j                    |dd	d
dddd          }|                                }|                     |d d         |                                d d                    |                     d|j                    G d d          } |dd	d
dddd |                      }|                                }|                     |d d         |                                d d                    |                     d|j                    G d d          } |dd	d
dddd |                      }|                     t0          |j                    |ddddddd          }t2          j        t2          j        t2          j        fD ]}|                    |          }	|                     |	                                d d         |	                    t2          j                                                  d d                     |t>          ddddd |d                    }
|                     t@          |
j                    |tB          ddd d!dd" |d#                    }|                     t@          |j                   |j                            t3          tD                              }
|                     t@          |
j                   |j                            t3          tD                               }|                     t@          |j                   d S )$Nc                       e Zd ZddZd ZdS )-TestDateTimeTZ.test_utctimetuple.<locals>.DSTr   c                 ^    t          |t                    rt          |          }|| _        d S rh   r  r  s     r#   rs   z6TestDateTimeTZ.test_utctimetuple.<locals>.DST.__init__  r  r%   c                     | j         S r4   r  rx   s     r#   r   z1TestDateTimeTZ.test_utctimetuple.<locals>.DST.dst  r  r%   N)r   r  r   r%   r#   r  r    s7        ) ) ) )% % % % %r%   r  r&   r   r   c                   "    e Zd Zd fd	Zd ZdS ).TestDateTimeTZ.test_utctimetuple.<locals>.UOFSNc                 ^                         | |           t          |          | _        d S rh   )rs   r   uofs)r1   r  dofsr  s      r#   rs   z7TestDateTimeTZ.test_utctimetuple.<locals>.UOFS.__init__  s-    T4(((%d333			r%   c                     | j         S r4   )r  rx   s     r#   rz   z8TestDateTimeTZ.test_utctimetuple.<locals>.UOFS.utcoffset  s
    y r%   r4   r  )r  s   r#   UOFSr    sB        4 4 4 4 4 4! ! ! ! !r%   r  )r  r  r   NrY   rU   r'   r<  r  r  ir   r  r  c                       e Zd Zd ZdS ).TestDateTimeTZ.test_utctimetuple.<locals>.NOFSc                     d S r4   r   rx   s     r#   rz   z8TestDateTimeTZ.test_utctimetuple.<locals>.NOFS.utcoffset  s    tr%   Nr   r   r%   r#   NOFSr    s#            r%   r  c                       e Zd Zd ZdS ).TestDateTimeTZ.test_utctimetuple.<locals>.BOFSc                     dS )Nr   r   rx   s     r#   rz   z8TestDateTimeTZ.test_utctimetuple.<locals>.BOFS.utcoffset  s    ur%   Nr   r   r%   r#   BOFSr    s#            r%   r  r   rd  r  r  i+ r  r  r   r  r   r   r(  r  )#r   r=  r   r   rz   utctimetupler0   r_  r  r`  r  r  r  r   r!  r  r"  r  r#  rh  r   r$  r%  r  r   r   r   r6   r   r  r  r   r  r   r  )r1   rZ  r  r  r  r   r  r  r   dtzr  huger  s               @r#   test_utctimetuplez TestDateTimeTZ.test_utctimetuple  s8   	% 	% 	% 	% 	%& 	% 	% 	% m-#aAcc!ff555?	A 	A 	A	! 	! 	! 	! 	! 	! 	!3 	! 	! 	! ) 	, 	,HAq!RRDDh4G4GHHHA  AQVQY///QWah///QUAI...R+++R***QXqx000QYY[[!)444Q[[]]T!Q]]-D-D-F-FFJY( ( ( Q
++++ C1aRR((NN3B3ss!3444AJ'''	 	 	 	 	3 	 	 	 C1aRR777NN3B3ss!3444AJ'''	 	 	 	 	3 	 	 	 C1aRR777)Q^444 Cb"b"b&11<x|< 	L 	LB))2)&&CS--//4 ^^HL99CCEEcrcJL L L L
 s7Aq!Q44::>>>-):;;;s7BBBttE{{KKK-):;;;whv&6&677-):;;;whw&7&788-):;;;;;r%   c                    t          dd          }t          dd          }t          dd          }t          d d          }| j        }d}d ||||fD ]%}d	D ]} |d
ddddd||          }	d|rdpdz   }
|d ur|	                                pd}|
|z   }|	                                }|                     ||dz   |z              |                     ||	                    d                     |                     |	                    d          |dz   |z              |                     |	                    d          |dz   |z              |                     t          |	          |dz   |z               'd S )Nr   r     z+03:40iz-03:51r  z
0001-02-03)r   iy r&   rY   rU   r[   rV   r   r   z04:05:59z.987001r  ku   ሴr  )re   r=  r}   r  r0   r   )r1   r  plusminusunknownrZ  datestrofsrq  r  timestrofsstrtailstrisos                 r#   test_tzinfo_isoformatz$TestDateTimeTZ.test_tzinfo_isoformat  s   1h''3))D(++dB''mtUG3 	B 	BC 
B 
BC1aAr2c:::$(8y(>B?D7QXXZZ=2!F*kkmm  gmg&=>>>  akk#&6&6777  S!1!17S=73JKKK  X!6!6(8JW8TUUU  Q3)@AAAA
B	B 	Br%   c           	      v   | j         }t          dd          }t          t          d          d          }dddd	d
dd|g} || }|                     ||                                           d}dddddddd|ffD ]C\  }}|d d          }	||	|<    ||	 }
 |j        di ||i}|                     |
|           |dz  }D|                     |                                d           |                    d           }|                     |j                   |                     |                                           |                    |          }|                     ||           |                     |j        |j                    |ddd          }| 	                    t          |j        d           d S )Nr  r  r  ri   r  r&   rY   rU   r[   rV   r]   rX   r   rT  rU  rV  r  r  r  r  r   r   rS  r~  r  rW  r   r  r	  s                 r#   r_  zTestDateTimeTZ.test_replace  s   m3''Id333V<<1aAq!T*sDzt||~~...()'(**/&.0 	 	LD& 111gGGAJsG}H$,00$00CXs+++FAA 	///D))%,'''%,,..))) T**u%%%dk5<000 s4B*dl>>>>>r%   c                    t          d d          }t          dd          }t          t          d           d          }| j                            |          }|                     |j        |           |                     t          |j        |           |                    |j                  }|                     |j        |           | 	                    |
                                |
                                           | 	                    |                                |                                           |                    |          }|                     |j        |           | 	                    |                                t          d                     ||                                z
  }||                    |          z  }|                    |	          }| 	                    |
                                |
                                           | 	                    |                                |                                           | 	                    |                                |                                           |                     |j        |j                   | 	                    ||           d S )
NNoner  44rV   r   m300r  r  r   )re   r   r=  r   r5   r   r   r   r  r0   r   r   rz   r  r  )r1   fnonef44mfm5hry   r  r^  r	  s           r#   test_more_astimezonez#TestDateTimeTZ.test_more_astimezone  s2   D&))2t$$IA....77]$''bi&&&*bmU;;;MM")$$ah%%%27799---27799--- mmD!!cj$''')"*=*=*=>>>&DNN2&&&##4#00X]]__555X]]__555x'8'8999cj(/222h'''''r%   r   c                     | j                             t          j                  }|                     |                    d           |           |                     |                                |           d S r4   )r=  r   r   r6   r0   r  rx   s     r#   test_astimezone_default_utcz*TestDateTimeTZ.test_astimezone_default_utc)  s_    ]x|,,t,,b111"-----r%   ra  c                    |                      dddddt          j                  }|                                }|                     ||           |                     |                    d          d           |                      dddd	dt          j                  }|                                }|                     ||           |                     |                    d          d
           d S )Nrc  r   r[   r]   r  r   r  z	-0500 ESTrV   z	-0400 EDT)r=  r   r6   r  r0   r  )r1   ry   r  s      r#   test_astimezone_default_easternz.TestDateTimeTZ.test_astimezone_default_eastern1  s    ]]4Q2hl]CCU###00+>>>]]4Q2hl]CCU###00+>>>>>r%   c                     t          ddddt          j                  }|                                }|                                }|                     |j        |j                   d S )Nr-  r   r&   rV   r   )r   r   r6   r  r0   r   )r1   r   r   r  s       r#   !test_astimezone_default_near_foldz0TestDateTimeTZ.test_astimezone_default_near_fold<  sX     T2q!HL999LLNNLLNN18,,,,,r%   c                 x   | j         } G d dt                    } |ddddddd	 |            
          }|                    d          }|                    d          }|                    d          }|||fD ]B}|||fD ]:}||z
  }	t          |j        |j        z
            }
|                     |	|
           ;C |ddddddd	          }|                    d |                      }|                    d |                      }|                    d |                      }|||fD ]}|||fD ]~}||z
  }	||u s||u r||u s||u rt          d          }
nA||cxu r|u rn nt          d          }
n%||u rt          d          }
nt          d          }
|                     |	|
           d S )Nc                       e Zd Zd ZdS )BTestDateTimeTZ.test_aware_subtract.<locals>.OperandDependentOffsetc                 b    |j         dk     rt          |j                   S t          d          S r  r  r  s     r#   rz   zLTestDateTimeTZ.test_aware_subtract.<locals>.OperandDependentOffset.utcoffsetJ  r  r%   Nr   r   r%   r#   r  r  I  r  r%   r  r  r  r'   r   r   r  rd  r   rU   r|  ri   r  r   irO  )r=  r   r  r   r  r0   )r1   rZ  r  r[  r  r  rp  r  rl  r^  r	  s              r#   test_aware_subtractz"TestDateTimeTZ.test_aware_subtractD  sX   m	1 	1 	1 	1 	1V 	1 	1 	1 s1aRR4J4J4L4LMMM\\\##\\\##\\\$$R 	0 	0ARZ 0 0!e$QX-@AAA  h////0 s1aRR,,\\+A+A+C+C\DD\\+A+A+C+C\DD\\,B,B,D,D\EER 	0 	0ARZ 0 0!eGGqBwwQ"WWR(||HH!\\\\r\\\\\(||HH"WW(;;;HH  );;;H  h////0	0 	0r%   c           	         t          ddddddd          }t          ddddddd          }|                     ||           |                    d           }|                     ||           |                    t          d d	                    }|                     ||           |                    t          d
d	                    }|                     ||            G d dt
                    } |            }|                    |          }|                    |          }|                     |                                t          d                     |                     |                                t          d                     |                     ||           |                     |                      }|                     ||k                d S )Nr&   rY   rU   r[   rV   r]   rX   r   r  r   c                       e Zd Zd Zd ZdS )1TestDateTimeTZ.test_mixed_compare.<locals>.Variesc                 0    t          d          | _        d S r  r  r7   s    r#   rs   z:TestDateTimeTZ.test_mixed_compare.<locals>.Varies.__init__}  r  r%   c                 L    | xj         t          d          z  c_         | j         S r  r  r  s     r#   rz   z;TestDateTimeTZ.test_mixed_compare.<locals>.Varies.utcoffset  r  r%   Nr  r   r%   r#   r  r  |  r  r%   r  r   ri   r/  )	r   r0   r  re   r   r   rz   r   r   r  s        r#   rK  z!TestDateTimeTZ.test_mixed_comparep  s   aAq!Q**aAq!Q**R   ZZtZ$$R   ZZ{444Z55R   ZZ{1b11Z22B###	# 	# 	# 	# 	#V 	# 	# 	# FHHZZqZ!!ZZqZ!!2)>)>)>???2)>)>)>???R    ZZvvxxZ((R     r%   c                      G  fdd j                   }ddddddd	t          d
dd          f}  j         | } ||i ddi}                     |j        |                                |j        d                                |j        d                                |                                |                                                                |                    d          |j        |j	        z   dz
             d S )Nc                   $    e Zd ZdZ fdZd ZdS )2TestDateTimeTZ.test_subclass_datetimetz.<locals>.Crf   c                     |                                 }|                    d          } j        j        | g|R i |}||_        |S rj  rk  rm  s         r#   r   z:TestDateTimeTZ.test_subclass_datetimetz.<locals>.C.__new__  rq  r%   c                 &    || j         z   | j        z   S r4   )rf  r_  rs  s     r#   ru  z:TestDateTimeTZ.test_subclass_datetimetz.<locals>.C.newmeth  s    ty(4944r%   Nrv  r7   s   r#   rx  r    sB        I    5 5 5 5 5r%   rx  r^  r   r  r[   rV   r]   rI  r   r   r&   r   rX   rf   rZ   )
r=  re   r0   rJ   rw  r   rz   ru  rf  r_  rz  s   `    r#   test_subclass_datetimetzz'TestDateTimeTZ.test_subclass_datetimetz  s%   	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 RQ1c;tUA+F+FFdmT"a&'1&&***+++A&&&#--//:::R#(SX*=*ABBBBBr%   N)rK   rb   rc   r   r=  rN  rY  r  r6  r]  r  r  r  rw  r  r  r  r  r  r  r  r_  r  r   r@  r  r  r  r  rK  r  r   r%   r#   rL  rL    s       H	* 	* 	*C8 C8 C8JC C C.#= #= #=J/ / /> > ><5 5 5I I I?G ?G ?GB#N #N #NJ!= != !=F9 9 9
= 
= 
="O "O "OHN< N< N<`B B B*%? %? %?N( ( (: W. .  . W344? ? 54? W344- - 54-*0 *0 *0X! ! !<C C C C Cr%   rL  c                 \    d|                                  z
  }|r| t          |          z  } | S )Nr]   )r  r   )ry   
days_to_gos     r#   first_sunday_on_or_afterr    s3    RZZ\\!J $
i
###Ir%   ri   r   rV  r[   rY   r  c                   ,    e Zd Zd Zd Zd Zd Zd ZdS )
USTimeZonec                 Z    t          |          | _        || _        || _        || _        d S Nr   r   	stdoffsetreprnamestdnamedstnamer1   r   r  r  r  s        r#   rs   zUSTimeZone.__init__  -    "/// r%   c                     | j         S r4   r  r7   s    r#   rv   zUSTimeZone.__repr__  r{   r%   c                 H    |                      |          r| j        S | j        S r4   r   r  r  rx   s     r#   r}   zUSTimeZone.tzname  $    88B<< 	 <<r%   c                 <    | j         |                     |          z   S r4   r  r   rx   s     r#   rz   zUSTimeZone.utcoffset      ~,,r%   c                 :   ||j         t          S t          t                              |j                            }t          t                              |j                            }||                    d           cxk    r|k     r
n nt          S t          S NrW  r   )r   r   r  DSTSTARTr  r_  DSTENDr  r1   ry   rt  ends       r#   r   zUSTimeZone.dst  s    :* K ))9)9rw)9)G)GHH 'v~~27~'C'CDD
 BJJdJ++1111c11111KKr%   NrK   rb   rc   rs   rv   r}   rz   r   r   r%   r#   r  r    s_                 - - -    r%   r  r  r  r   r  r^   CentralCSTCDTrZ   MountainMSTMDTiPacificPSTPDTr   i0UTCfakec                   t    e Zd Z edddd          Z edddd          ZeZd Zd	 Zd
 Z	d Z
d Zd Zd ZdS )TestTimezoneConversionsr^  r[   rX   rY   r'   r.  r&   c                 z   |                      |                                t                     |                      |                    |          |           |                    |          }|                    |          }|                                |                                k    r|j        dk    r|                      |t          z   |           |                      |                                t                     |                      |                    |          |                    |                     n|                      ||           |t          z   }|                    |          }	|                                |                                k    r|j        dk    ru|                      |	|                    d                     |t          z  }|                    |          }	|                      |	|                    d                     d S |                      |	|z
  t                     d S )NrY   r   r&   r{  )r0   r   r  r  r   rf  r   r  )
r1   ry   r   r6   dstondstoffasutcthere_and_backnexthour_utcnexthour_tzs
             r#   checkinsidez#TestTimezoneConversions.checkinside  s   4((( 	r**B///c""))"-- 7799

$$A ^d2B777 ^//114888^66s;;]]3//1 1 1 1 R000 t|"--b117799%%"'Q,, ["**!**<*<===D L&11"55K["**!**<*<=====[2-t44444r%   c                 2   |                      |                                t                     |                      |                    |          |           |                    |          }|                    |          }|                      ||           d S r4   )r0   r   r   r  )r1   ry   r   r6   r  r  s         r#   checkoutsidez$TestTimezoneConversions.checkoutside+  s    4((( 	r**B/// c""))"--^,,,,,r%   c           	         | j                             |          }| j                            |          }t          d          t          t
          t          d          t          d          fD ]|}|                     |||||           ||z   ||z
  fD ]}|                     |||||           |                     |||           ||z
  ||z   fD ]}|                     |||           }d S )Nr   r  rW  r&   ri   r   )r	  r  r
  r   DAYr  r  r  )r1   r   r6   r	  r
  r,  duringoutsides           r#   convert_between_tz_and_utcz2TestTimezoneConversions.convert_between_tz_and_utc6  s.   
""""-- $$B$//b)))***Q///	1 	4 	4E UBUF;;;%-%7 A A  S%@@@@fb#... 5=&5.8 4 4!!'2s33334	4 	4r%   c                    |                      t          t                     |                      t          t                     |                      t          t                     |                      t          t                     |                      t          t                     |                      t          t                     d S r4   )r  r  utc_realr  utc_faker7   s    r#   	test_easyz!TestTimezoneConversions.test_easyL  s    '':::'':::'':::''::: 	''999''99999r%   c           	      z   | j         t          d          z
  }t          ddd          }|                    |          }| j                             d          }|                    t
                                        d           }|                     ||           | j                             d	t          
          }| j                             d          }|                    t
                                        d           }|                     ||           t          t          fD ]}t
          t          fD ]}| j
        t          d          z
  }||                    d           z  }||                    d           z   }	|	                    |          }
dD ]}| j
                            |          }dD ]m}|                    |          }|
                    |          }	|	                    |          }|                     |                    d           |           n|
t          z  }
d S )Nr[   r   iz-0900r   r   rU   r{  r]   rf  r   r&   rY   )r   r&   r&   rY   r   r  r   r|  )r	  r   re   r  r  r  r0   r  r  r  r
  rz   r  )r1   fourbackninewestr	  r^  sixutcr6   r   first_std_hourr  	asutcbasetzhourexpectedbaser  astzs                  r#   test_trickyz#TestTimezoneConversions.test_trickyd  sD   :	 2 2 22ugq11##8#44 :%%1%--!!'**22$2??3''' ##8#<< :%%1%--((000==3''' X% 	& 	&Cw& & &!%yq/A/A/A!A",,t"4"44&t)<)<< "MMM55	* & &F#';#6#6F#6#C#CL"+ N N#/#7#7v#7#F#F ) 1 1 1 @ @$//33((T)B)BHMMMM%II&&	& 	&r%   c                     G d dt                     }| j                                                            t                    }|                     |                        G d d|          }|                     t          |j         |                        G d d|          }|                     dd	d	                              t                    }|                     t          |j         |                       d S )
Nc                       e Zd Zd Zd ZdS )2TestTimezoneConversions.test_bogus_dst.<locals>.okc                     t           S r4   r  rx   s     r#   rz   z<TestTimezoneConversions.test_bogus_dst.<locals>.ok.utcoffset  s    D[r%   c                     t           S r4   r+  rx   s     r#   r   z6TestTimezoneConversions.test_bogus_dst.<locals>.ok.dst  s    d{r%   Nr  r   r%   r#   okr)    s"        000*****r%   r-  r   c                       e Zd Zd ZdS )5TestTimezoneConversions.test_bogus_dst.<locals>.notokc                     d S r4   r   rx   s     r#   r   z9TestTimezoneConversions.test_bogus_dst.<locals>.notok.dst  r  r%   NrK   rb   rc   r   r   r%   r#   notokr/    s        *****r%   r2  c                       e Zd Zd ZdS )<TestTimezoneConversions.test_bogus_dst.<locals>.tricky_notokc                 0    |j         dk    rd S dt          z  S )NrS  r'   )r_  r  rx   s     r#   r   z@TestTimezoneConversions.test_bogus_dst.<locals>.tricky_notok.dst  s    7d??4d7Nr%   Nr1  r   r%   r#   tricky_notokr4    s#        # # # # #r%   r6  r  r&   )r   r=  r   r  r  r  r   r   )r1   r-  r   r2  r6  ry   s         r#   test_bogus_dstz&TestTimezoneConversions.test_bogus_dst  s,   	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ m!!)))::rrtt	+ 	+ 	+ 	+ 	+B 	+ 	+ 	+*cneegg>>>	# 	# 	# 	# 	#2 	# 	# 	# ]]4A&&..h.??*bm\\^^DDDDDr%   c                 
   |                      t          t          j                   t	          j                                        t                    }|                      t          t          j        |           |                    t                    }t                              |          }| 	                    |j
        t                     |                      t          t          j        ||           |                      t          t          j        t          j                                G d dt                    } |dddd          }| j                            dt          	          }|                    |          }d
D ]}|                    |          }|dk    r|t          d          z  }t                              |          }	| 	                    ||	           ||j        z   }|                    |          }	| 	                    ||	           |                    t                                        |          }	| 	                    ||	           |t$          z  }|t$          z  }| j                            dt          	          }|                    |          }dD ]}|                    |          }t                              |          }	| 	                    ||	           ||j        z   }|                    |          }	| 	                    ||	           |                    t                                        |          }	| 	                    ||	           |t$          z  }|t$          z  }d S )Nr   c                       e Zd Zd ZdS )<TestTimezoneConversions.test_fromutc.<locals>.FauxUSTimeZonec                     || j         z   S r4   )r  rx   s     r#   r   zDTestTimezoneConversions.test_fromutc.<locals>.FauxUSTimeZone.fromutc  s    DN**r%   NrK   rb   rc   r   r   r%   r#   FauxUSTimeZoner:    s#        + + + + +r%   r=  r  FEasternFESTFEDTr[   r  )r   r   r&   rU   r[   rV   r{  r   r&   rV  )r   r&   r&   rY   rU   r[   )r   r   r  r   r   r  r  r  r   r0   r   r   rb  r  r	  r   r  r  r  r
  )
r1   r   enowr=  r>  rt  fstartwallr	  r^  s
             r#   r  z$TestTimezoneConversions.test_fromutc  s)   )W_555o''x'88*gos;;;kkk))s##g...)W_c3???)W_djllCCC	+ 	+ 	+ 	+ 	+Z 	+ 	+ 	+ #N2zFFCC 
""'"::h//% 	 	D}}$}//HrzzI1----//%((CXs+++ 22H""6**CXs+++ ...11<<XFFCXs+++TMEdNFF ##7#;;h//$ 	 	D}}$}//H//%((CXs+++ 22H""6**CXs+++ ...11<<XFFCXs+++TMEdNFF	 	r%   N)rK   rb   rc   r   r	  r
  r=  r  r  r  r  r&  r7  r  r   r%   r#   r  r    s        HT1a##EXdBA&&FH15 15 15h	- 	- 	-4 4 4,
: 
: 
:00& 0& 0&fE E E6: : : : :r%   r  c                        e Zd Zd Zd Zd ZdS )Oddballsc                 P   t          j                    t          j        t	                                |                     k               |                     k               |                     k               |                     k               |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           |                     t          fd           | 	                    
                              d	           j        d
z   dz  d
z   }                    |          }| 	                    
                    |          d           t          j        j        j                  }| 	                    |           | 	                    |           t!          j        j        j        ddd          }| 	                    |           | 	                    |           d S )Nc                       k     S r4   r   as_dateas_datetimes   r#   rE  z+Oddballs.test_bug_1028306.<locals>.<lambda>      W{-B r%   c                       k     S r4   r   rH  s   r#   rE  z+Oddballs.test_bug_1028306.<locals>.<lambda>      [7-B r%   c                       k    S r4   r   rH  s   r#   rE  z+Oddballs.test_bug_1028306.<locals>.<lambda>      W-C r%   c                       k    S r4   r   rH  s   r#   rE  z+Oddballs.test_bug_1028306.<locals>.<lambda>       [G-C r%   c                       k    S r4   r   rH  s   r#   rE  z+Oddballs.test_bug_1028306.<locals>.<lambda>  rK  r%   c                       k    S r4   r   rH  s   r#   rE  z+Oddballs.test_bug_1028306.<locals>.<lambda>  rM  r%   c                       k    S r4   r   rH  s   r#   rE  z+Oddballs.test_bug_1028306.<locals>.<lambda>  rO  r%   c                       k    S r4   r   rH  s   r#   rE  z+Oddballs.test_bug_1028306.<locals>.<lambda>  rQ  r%   Tr&   r<  )r  Fr   )r   rb  r   r  r   r   r   r   r   r0   __eq__r  r  rW  r_  r`  r  )r1   different_dayas_differentdate_scdatetime_scrI  rJ  s        @@r#   test_bug_1028306zOddballs.test_bug_1028306  s    *,,&w77;.///w.///K/000/000)%B%B%B%B%BCCC)%B%B%B%B%BCCC)%C%C%C%C%CDDD)%C%C%C%C%CDDD)%B%B%B%B%BCCC)%B%B%B%B%BCCC)%C%C%C%C%CDDD)%C%C%C%C%CDDD 	44d;;; qB.2"***>>55u=== w|W]GKHH'***'*** '{'79J'.{Aq!= =k222k22222r%   c           	      L   t          j                    t                      t          j                    t                      t                      t          t                                fD ];}|                     t                    5  d|_
        d d d            n# 1 swxY w Y   <d S r  )r   rb  r   r   r  r   r   r   r   AttributeErrorr(   )r1   r  s     r#   test_extra_attributeszOddballs.test_extra_attributes  s    *,,&&/##++((9;;'') 	 	A "">22                	 	s   BB	B	c                     G d d          } G d dt                     }d |d          t          j        d          t          j        d           |d           |d          d	fD ]}|                     t          t
          |dddddd	  	         |                     t          t
          d|ddddd	  	         |                     t          t
          dd|dddd	  	         |                     t          t
          ddd|ddd	  	         |                     t          t
          dddd|dd	  	         |                     t          t
          ddddd|d	  	         |                     t          t
          dddddd|	  	         d S )
Nc                       e Zd Zd Zd ZdS )-Oddballs.test_check_arg_types.<locals>.Numberc                     || _         d S r4   value)r1   rd  s     r#   rs   z6Oddballs.test_check_arg_types.<locals>.Number.__init__%  s    "


r%   c                     | j         S r4   rc  r7   s    r#   __int__z5Oddballs.test_check_arg_types.<locals>.Number.__int__'  s
    z!r%   N)rK   rb   rc   rs   rf  r   r%   r#   Numberra  $  s2        # # #" " " " "r%   rg  c                       e Zd ZdS ),Oddballs.test_check_arg_types.<locals>.FloatNr  r   r%   r#   Floatri  *  r  r%   rj  g      $@g%@r'   z10.910)r-  decimalDecimalr   r   r   )r1   rg  rj  xxs       r#   test_check_arg_typeszOddballs.test_check_arg_types#  s   	" 	" 	" 	" 	" 	" 	" 	"	 	 	 	 	E 	 	 	 t?2&&(?(?6"::vvd|| 
	O 
	OB i2r2r2r2NNNi2r2r2r2NNNi2r2r2r2NNNi2r2r2r2NNNi2r2r2r2NNNi2r2r2r2NNNi2r2r2r2NNNN
	O 
	Or%   N)rK   rb   rc   r[  r^  ro  r   r%   r#   rE  rE    sG        #3 #3 #3J  O O O O Or%   rE  c                       e Zd Zd ZdS )tzinfo2c                 z   	 t          |t                    st          d          |j        | urt	          d          |                    d                                          }|                    d                                          }|||                                t          ||k    r!||z   }|                                }||k    r|S ||fD ]U}||z   }|                                |k    r|c S |                    d          }|                                |k    r|c S Vt	          d          )N&fromutc() requires a datetime argumentdt.tzinfo is not selfr   r9  r&   zNo suitable local time found)rk   r   r   r   r   r  rz   r   )r1   ry   off0off1ldtoffs         r#   r   ztzinfo2.fromutcA  sK   4"h'' 	FDEEE9D  4555 zzqz!!++--zzqz!!++--<4<26688+;4<<t)C==??Dt||
 $< 	 	Cs(C}}#%%


++1+%%C}}#%%


 & 7888r%   Nr<  r   r%   r#   rq  rq  ?  s#        9 9 9 9 9r%   rq  c                   ,    e Zd Zd Zd Zd Zd Zd ZdS )USTimeZone2c                 Z    t          |          | _        || _        || _        || _        d S r  r  r  s        r#   rs   zUSTimeZone2.__init__c  r  r%   c                     | j         S r4   r  r7   s    r#   rv   zUSTimeZone2.__repr__i  r{   r%   c                 H    |                      |          r| j        S | j        S r4   r  rx   s     r#   r}   zUSTimeZone2.tznamel  r  r%   c                 <    | j         |                     |          z   S r4   r  rx   s     r#   rz   zUSTimeZone2.utcoffsetr  r  r%   c                    ||j         t          S t          t                              |j                            }t          t                              |j                            }|                    d           }|t          z   |cxk    r|k     r
n nt          S ||cxk    r|t          z   k     rn n|j        rt          nt          S ||cxk    r|t          z   k     rn n|j        rt          nt          S t          S r  )	r   r   r  r  r  r_  r  r  r:  r  s       r#   r   zUSTimeZone2.dstu  s   :* K ))9)9rw)9)G)GHH 'v~~27~'C'CDD
 ZZtZ$$4<2#########KB####t#####7,44,b''''54<'''''7,44, Kr%   Nr  r   r%   r#   rz  rz  a  s_                 - - -    r%   rz  Eastern2Central2	Mountain2Pacific2c                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )Europe_Vilnius_1941c                 R    t          dddd|           t          dddd|           gS )N  r]   r   r   r   r  r   r7   s    r#   	_utc_foldzEurope_Vilnius_1941._utc_fold  s8    q"b666q"b6668 	8r%   c                 R    t          dddd|           t          dddd|           gS )Nr  r]   r   r   r/  r   r  r7   s    r#   	_loc_foldzEurope_Vilnius_1941._loc_fold  s8    q"b666q"a5557 	7r%   c                     |                                  \  }}||k     r
dt          z  S ||k     r|j        rdndt          z  S dt          z  S )NrU   rY   r  r  r:  r1   ry   
fold_start	fold_stops       r#   rz   zEurope_Vilnius_1941.utcoffset  P     $ 0 0
I
??t8O	>>'AAa4//4xr%   c                     |                                  \  }}||k     r
dt          z  S ||k     r|j        rdndt          z  S dt          z  S )Nr   r&   r  r  s       r#   r   zEurope_Vilnius_1941.dst  r  r%   c                 j    |                                  \  }}||k     rdS ||k     rd|j                 S dS )NMSK)r  CESTr  )r  r:  r  s       r#   r}   zEurope_Vilnius_1941.tzname  s?     $ 0 0
I
??5	>>"27++vr%   c                     |j         dk    rt          |                                 \  }}||k     r|dt          z  z   S ||k     r!|dt          z  z                       d          S |dt          z  z   S )Nr  rU   rY   r&   r9  )r_  r   r  r  r  r  s       r#   r   zEurope_Vilnius_1941.fromutc  sv     7d??%% $ 0 0
I
??D= 	>>TM***222AH}r%   N)	rK   rb   rc   r  r  rz   r   r}   r   r   r%   r#   r  r    sn        8 8 87 7 7          r%   r  c                   n   e Zd Zd Zd Zd Zd Zd Zd Zd Z	 e
j        d          d	             Z e
j        d
          d             Zd Z e
j        d          d             Z e
j        d
          d             Z e
j        d          d             Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )TestLocalTimeDisambiguationc           	         t                      }t          ddddddt          j                  }|                    |          }|                     |                    d          d           |                     |j        d	           |                     |	                                           t          dddd
t          j                  }|                    |          }|                     |                    d          d           |                     |j        d           | 
                    |	                                           t          ddddt          j                  }|                    |          }|                     |                    d          d           |                     |j        d	           | 
                    |	                                           d S )Nr  r]   r   r<  r   r   z%c %Z%zz!Mon Jun 23 23:59:59 1941 MSK+0300r   r   z"Mon Jun 23 23:00:00 1941 CEST+0200r&   r  z"Tue Jun 24 00:00:00 1941 CEST+0200)r  r   r   r6   r  r0   r  r:  r   r   r   )r1   Vilniusgdtrw  s       r#   test_vilnius_1941_fromutcz5TestLocalTimeDisambiguation.test_vilnius_1941_fromutc  s   %''tQBBx|DDDnnW%%i00<	> 	> 	>1%%%###tQBx|<<<nnW%%i00=	? 	? 	?1%%%		"""tQBx|<<<nnW%%i00=	? 	? 	?1%%%		"""""r%   c           
         t                      }t          dddddd|          }|                    t          j                  }|                     |                    d          d           t          dddddd|          }|                    t          j                  }|                     |                    d          d	           t          dddddd|d
          }|                    t          j                  }|                     |                    d          d           t          dddd|          }|                    t          j                  }|                     |                    d          d           d S )Nr  r]   r   r  r   r   z%c %ZzMon Jun 23 19:59:59 1941 UTCzMon Jun 23 20:59:59 1941 UTCr&   )r   r:  zMon Jun 23 21:59:59 1941 UTCr/  r   zMon Jun 23 22:00:00 1941 UTC)r  r   r  r   r6   r0   r  )r1   r  rw  r  s       r#   test_vilnius_1941_toutcz3TestLocalTimeDisambiguation.test_vilnius_1941_toutc  s{   %''tQBBw???nnX\**g..7	9 	9 	9 tQBBw???nnX\**g..7	9 	9 	9 tQBBwQGGGnnX\**g..7	9 	9 	9 tQAg666nnX\**g..7	9 	9 	9 	9 	9r%   c           	      H   t          dd          }t          dddd          }|                     |j        d           |                     |j        d           |                     t
                    5  t          ddddd d           d d d            d S # 1 swxY w Y   d S Nr   r&   r9  )r   r   r0   r:  r   r   r1   r   ry   s      r#   test_constructorsz-TestLocalTimeDisambiguation.test_constructors  s    OOOaAA&&&###!$$$y)) 	& 	&Aq!T1%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&s   5BBBc                     t          dddd          }|                                }|                     |j        d           |                                }|                     |j        d           d S )Nr&   r9  )r   r   r0   r:  r  )r1   ry   r   s      r#   test_memberz'TestLocalTimeDisambiguation.test_member  sh    aAA&&&GGII###IIKK#####r%   c                 @   t          d          }t          ddd          }|                     |                    d          j        d           |                     |                    d          j        d           |                     |                    d          j        d           |                     |                    d          j        d           |                    dt
                    }|                    dt
                    }|                     |                    d           j        d           |                     |                    d           j        d           |                     t                    5  |                    d           d d d            n# 1 swxY w Y   |                     t                    5  |                    d           d d d            n# 1 swxY w Y   |                     t                    5  |                    dddd d           d d d            n# 1 swxY w Y   |                     t                    5  |                    dddddddd d	  	         d d d            d S # 1 swxY w Y   d S )Nr   r&   r9  )r:  r   r   rY   )	r   r   r0   r  r:  r  r   r   r   r  s      r#   r_  z(TestLocalTimeDisambiguation.test_replace  sK   GGaA**/333++0!444**/333++0!444II1WI--ZZQwZ//$//4a8884005q999z** 	 	II1I	 	 	 	 	 	 	 	 	 	 	 	 	 	 	z** 	 	JJAJ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 y)) 	( 	(IIaAtQ'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(y)) 	5 	5JJq!Q1aD!444	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5sH   F00F47F4G88G<?G<II
I(JJJc                     t          d          }t          ddd          }|                     ||                    d                     |                     ||                    d                     d S r  )r   r   r0   r  r  s      r#   r  z+TestLocalTimeDisambiguation.test_comparison.  sl    GGaAAII1I--...RZZQZ//00000r%   c                 V   t          d          }t          ddd          }|                     t          |          t          |                    d                               |                     t          |          t          |                    d                               d S r  )r   r   r0   r  r  r  s      r#   	test_hashz%TestLocalTimeDisambiguation.test_hash4  s    GGaAa$qyyay'8'8"9"9:::b4


(:(:#;#;<<<<<r%   ra  c                     d}t          j        |          }t          j        |dz             }|                     |j        d           |                     |j        d           d S )NiXUTr  r   r&   )r   r  r0   r:  )r1   r  dt0r   s       r#   r  z.TestLocalTimeDisambiguation.test_fromtimestamp:  sa    $Q''$QX..1%%%1%%%%%r%   zAustralia/Lord_Howec                 |   t          j        d          }t          j        d|          dk    r|                     d           d}t	          j        |          }t	          j        |dz             }|                     ||           |                     |j        d           |                     |j        d           d S )	N   A%Z%z	LHST+1030>Australia/Lord_Howe timezone is not supported on this platformiU  r   r&   )r  r[  r  rL   r   r  r0   r:  )r1   tmr  rd  r  s        r#   test_fromtimestamp_lord_howez8TestLocalTimeDisambiguation.test_fromtimestamp_lord_howeB  s    _U##>&"%%44MMZ[[[
 #A&&#AH--R   !$$$!$$$$$r%   c                 `    |                      t          j        d          j        d           d S rZ  )r0   r   r  r:  r7   s    r#   %test_fromtimestamp_low_fold_detectionzATestLocalTimeDisambiguation.test_fromtimestamp_low_fold_detectionR  s.     	/227;;;;;r%   c                     t          ddddd          }|                    d          }|                     |                                dz   |                                           d S )Nr   r   rY   r&   r  r9  r  )r   r  r0   r  )r1   r  r   s      r#   test_timestampz*TestLocalTimeDisambiguation.test_timestampW  sf    tRAr**kkqk!!4/	* 	* 	* 	* 	*r%   c                    t          j        d          }t          j        d|          dk    r|                     d           t	          ddddd	          }|                    d
                                          }|                    d                                          }|                     |dz   |           d S )Nr  r  r  r  r-  r[   rV   r&   r  r   r9  r  )r  r[  r  rL   r   r  r  r0   )r1   r  r   s0s1s        r#   test_timestamp_lord_howez4TestLocalTimeDisambiguation.test_timestamp_lord_howe^  s    _U##>&"%%44MMZ[[[T1aB''YYAY((**YYAY((**dB'''''r%   c                    t          ddddd          }|                    d          }|                                }|                                }|                     |                                d           |                     |                                d           |                     |t
          z   |           |                     |j        d	           |                     |j        d	           d S )
Nr   r   rY   r&   r  r9  r  r   r   )r   r  r  r0   r}   r  r:  )r1   r  r   adt0adt1s        r#   r  z+TestLocalTimeDisambiguation.test_astimezoneh  s    tRAr**kkqk!!~~~~......d+++A&&&A&&&&&r%   c                 H   t          d          }t          dddd          }t          D ]v\  }}}||fD ]k}|                    ||          }|                    |          }|                     ||           |                     |dk     rdn|j        |j                   lwd S )Nr&   r9  r[   r   )r   r   r   r   r   r0   r:  )	r1   r   ry   r   r   r"   r  r  rl  s	            r#   test_pickle_foldz,TestLocalTimeDisambiguation.test_pickle_foldw  s    aLLLaAA&&&)7 	G 	G%GYW G GMM!U++OOA&&  A&&&  uqyy!!afqvFFFF	G	G 	Gr%   c                     t          d          }t          dddd          }|                     t          |          d           |                     t          |          d           d S )Nr&   r9  zdatetime.time(0, 0, fold=1)z(datetime.datetime(1, 1, 1, 0, 0, fold=1))r   r   r0   r   r  s      r#   r   z%TestLocalTimeDisambiguation.test_repr  st    aLLLaAA&&&a"?@@@bC	E 	E 	E 	E 	Er%   c           	      p   t          ddddt                    t          j        z
  }t          ddddt                    }|                     |                                t                     |                     |                                t                     |                     |                    d                                          t                     |                     |                    d                                          t                     dD ]}t          dddd|t                    }|                     |                                t                     |                     |                    d                                          t                     dD ]}t          dd	d
d|t                    }|                     |                                t                     |                     |                    d                                          t                     d S )Nr^  r'   r.  r&   r   rY   r9  r  r[   rX   )	r   r  r   r  r0   r   r  r   r  )r1   	dt_summer	dt_winterr  ry   s        r#   r	  z$TestLocalTimeDisambiguation.test_dst  s   T2r1X>>>AUU	T2r1X>>>	$///$///***226688$???***226688$??? " 	= 	=F$B6(CCCBRVVXXt,,,RZZQZ//3355t<<<< " 	= 	=F$1aAAABRVVXXt,,,RZZQZ//3355t<<<<	= 	=r%   c                 T   t          ddddt                    t          j        z
  }t          ddddt                    }|                     |                                dt          z             |                     |                                dt          z             |                     |                    d	                                          dt          z             |                     |                    d	                                          dt          z             d S )
Nr^  r'   r.  r&   r   rY   r\   r  r9  )r   r  r   r  r0   rz   r  r  )r1   r  r  s      r#   r  z*TestLocalTimeDisambiguation.test_utcoffset  s    T2r1X>>>AUU	T2r1X>>>	,,..T	:::,,..T	:::***22<<>>T	JJJ***22<<>>T	JJJJJr%   c                 (   t          ddddt                    t          j        z
  }t          ddddt                    }t                              |          }t                              |          }|                     ||dt          z  z
             |                     ||dt          z  z
             |                     |j        d	           |                     |j        d	           t          ddddd
t                    }t                              |          }|t          z  }t                              |          }|                     ||           |                     |j        d	           |                     |j        d           t          ddddd
t                    }t                              |          }|                     |j        |j	        fd           t          ddddd
t                    }t                              |          }|                     |j        |j	        fd           t          ddddd	t                    }t                              |          }|                     |j        |j	        fd           d S )Nr^  r'   r.  r]   r   rX   r[   rV   r   r  r&   )r   r   )r.  r&   rY   )r]   r   )
r   r  r   r  r   r0   r  r:  r  rf  )	r1   u_summeru_wintert_summert_winterr   rd  r  r   s	            r#   r  z(TestLocalTimeDisambiguation.test_fromutc  sH   D"b!H===	@TTD"b!H===##H--##H--8a$h#67778a$h#6777****** T2r1b:::a  	T	a  R   !$$$!$$$T2r1b:::Q!%(333T2r1b:::Q!%'222 T1aAh777Q!%'22222r%   c                 2   t          dddt                    }|                     ||                    t          j                             t          dddt                    }|                     ||                    t          j                             d S )NrS  r&   r   r]   )r   r  r0   r  r   r6   r  s     r#   test_mixed_compare_regularz6TestLocalTimeDisambiguation.test_mixed_compare_regular  s|    T1a111ALL66777T1a111ALL6677777r%   c                     t          dddddt                    }|                    t          j                  }|                     ||           |                     ||           d S )Nr^  r'   r.  r&   r  r   r   r  r  r   r6   r   )r1   t_fold
t_fold_utcs      r#   test_mixed_compare_foldz3TestLocalTimeDisambiguation.test_mixed_compare_fold  sc    $B2h???&&x|44
FJ///J/////r%   c                     t          dddddt                    }|                    t          j                  }|                     ||           |                     ||           d S )Nr^  r[   rX   rY   r  r   r  )r1   t_gap	t_gap_utcs      r#   test_mixed_compare_gapz2TestLocalTimeDisambiguation.test_mixed_compare_gap  sc    q!Q8<<<$$X\22	E9---Iu-----r%   c                 6   t          dddt                    }|                     t          |          t          |                    d                               t          dddddt                    }t          dd	d
ddt                    }|                     t          |          t          |                    d                               |                     t          |          t          |                    d                               d S )NrS  r&   r   r9  r^  r'   r.  r  r[   rX   rY   )r   r  r0   r  r  )r1   r   r  r  s       r#   test_hash_awarez+TestLocalTimeDisambiguation.test_hash_aware  s    T1a111a$qyyay'8'8"9"9:::$B2h???q!Q8<<<ftFNNN,B,B'C'CDDDed5==a=+@+@&A&ABBBBBr%   N)rK   rb   rc   r  r  r  r  r_  r  r  r   r@  r  r  r  r  r  r  r  r   r	  r  r  r  r  r  r  r   r%   r#   r  r    s       # # #09 9 9.& & &$ $ $5 5 5.1 1 1= = = W344& & 54& W.//% % 0/%< < <
 W344* * 54* W.//( ( 0/( W344' ' 54'G G GE E E= = =6K K K3 3 3B8 8 80 0 0. . .C C C C Cr%   r  c                 p    t          j        |           \  }}t          |d            t          ||          S r4   )r  teenextrk  )iterablern  ro  s      r#   pairsr    s0    =""DAqDMMMq!99r%   c                      e Zd ZdZd Zed             Zed             Zed             Z	 e
ddd                                          Zd Zd	 Zd
 Zd Zd Zedd            Zedd            Zd Zd Zedd            Zd Zd Zd ZdS )ZoneInfoz/usr/share/zoneinfoc                 Z    	 || _         || _        |                     ||          | _        d S r4   )uttiinvertr   )r1   r  r  s      r#   rs   zZoneInfo.__init__  s0    	 ++b"%%r%   c                    t          d|           t          d|           f}| r|d         d         t          z  }|d         dxx         |z  cc<   |d         dxx         |z  cc<   t          dt          |                     D ]Y}|d         |xx         ||dz
           d         t          z  z  cc<   |d         |xx         ||         d         t          z  z  cc<   Z|S )Nr#  r   r&   )r   SECrl  r  )r  r  r   rq   rr  s        r#   r  zZoneInfo.invert  s    CnneCnn- 	,U1X_FqE!HHHHHHqE!HHHHHH1c"gg&& , ,1aBqsGAJ#--1aBqE!HO+	r%   c           	      F   |                     d                                          dk    rt          d          |                    d           t	          d          }|                    |d           t          j        dk    r|                                 t	          d          }|                    ||d                    t          j        dk    r|                                 t	          d	          }|                    ||d                    g }t          |d
                   D ]=}|
                    t          j        d|                     d                               >|                     |d                   }t          |          D ]O\  }\  }}	}
||
|                    d|
                                                   }t          d|          |	|f||<   Pd gt!          |          z  }t          |          D ]\  }}||         ||<    | ||          }|S )Nr[   TZifznot a zoneinfo filer   rr  rU   r  r   r  r&   z>lbbr]   rY   )readdecoder   seekr   fromfilerI   	byteorderbyteswaprl  r  structunpackr  findr   r  )rZ  fileobjcountsr  type_indicesttisrr  abbrsgmtoffisdstabbrindabbrr  idxr1   s                  r#   r  zZoneInfo.fromfile
  s   <<??!!##v--2333Rs###=E!!OO3ZZ
GVAY'''=E!!KKMMMSzzgvay111vay!! 	@ 	@AKKfgll1oo>>????VAY'' ,5T?? 	: 	:'A'wAw!7!778??AAD F++UD9DGGVc"gg-- 	 	FAsIBqEEs2r{{r%   c                     t           j                            | j        |          }t	          |d          5 }|                     |          cd d d            S # 1 swxY w Y   d S )Nrb)ospathjoinzonerootopenr  )rZ  rF   r  r  s       r#   fromnamezZoneInfo.fromname/  s    w||CL$//$ 	#<<??	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#s   AAArO  r&   c                 L   	 t          |t                    st          d          |j        | urt	          d          |                                | j        z
  dz  |j        dz  z   |j        dz  z   |j	        z   }|| j
        d         k     r| j        d         }d}net          j        | j
        |          }| j        |dz
  |         \  }}|d         |d         z
  }|t          d|| j
        |dz
           z
            k    }||d         z  }|r|                    d	          S |S )
Nrs  rt  r_  r  rX  r&   r   rY   r9  )rk   r   r   r   r   rh  EPOCHORDINALrf  r  r  r  r  bisectbisect_rightr   r  )r1   ry   r  ttir:  r  tti_prevshifts           r#   r   zZoneInfo.fromutc7  s;   8"h'' 	FDEEE9D  4555llnnt'88EAw~&y2~& y!	
 twqz!!'!*CDD%dgy99C !GCE#I.MHcQK#a&(EIaTWSU^)CDDDD
c!f 	::1:%%%Ir%   c                    |                                 | j        z
  dz  |j        dz  z   |j        dz  z   |j        z   }| j        |j                 }t          j        ||          }| j	        t          d|dz
                     |         S )Nr_  r  rX  r   r&   )rh  r  rf  r  r  r   r:  r  r  r  r   )r1   ry   rr  r  r   r  s         r#   _find_tizZoneInfo._find_tiU  s    llnnt'88EAw~y2~ y	 WRW!"i00ws1cAg'**r%   c                 .    |                      |d          S rZ  r	  rx   s     r#   rz   zZoneInfo.utcoffset_      }}R###r%   c                 N    |                      |d          }|rt          nt          S r  )r	  r   r  )r1   ry   r  s      r#   r   zZoneInfo.dstb  s&    b!$$
 &tt$&r%   c                 .    |                      |d          S )NrY   r  rx   s     r#   r}   zZoneInfo.tznamej  r  r%   Nc              #   p  K   || j         }t          j                            |d          }	 t	          |          }n# t
          $ r Y d S w xY w|5  |D ]I}|                                }|r1|                    d          s|                                d         V  J	 d d d            d S # 1 swxY w Y   d S )Nzzone.tab#rY   )	r  r  r  r  r  ri  striprD   r  )rZ  zonedirzone_tabr  lines        r#   	zonenameszZoneInfo.zonenamesm  s     ?lG7<<44	XAA 	 	 	FF	 	* 	* * *zz|| * 4 4 ***,,q/)))*	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*s"   = 
A
AAB++B/2B/c                    dx}x}x}}t           j        x}}t          x}}	t          j        x}
}d x}}t          j        x}}d x}}t          |dd          }|                                 D ]}|dz  }|                     |          }|                                D ]\  }}||k     r|t          k    r@|dz  }||f||fk    r|}|}|}|t          j        |z
  f|t          j        |
z
  fk     r|}|}|}
W|t          k     rC|dz  }| }||f|	|fk    r|}	|}|}|t          j        |z
  f|t          j        |z
  fk     r|}|}|}|dz  }|||f}t          d|z             t          dt          |          f|z   z             t          d|dd|
d|           t          d	|dd|d|           t          d
|dd|d|           t          d|	dd|d|           d S )Nr   r&   zNumber of zones:       %5dz@Number of transitions: %5d = %d (gaps) + %d (folds) + %d (zeros)zMin gap:         z>16z at z in zMax gap:         zMin fold:        zMax fold:        )
r   r   r   r   r   r  r   transitionsprintr  )rZ  
start_yearcount	gap_count
fold_countzeros_countmin_gapmin_foldmax_gapmax_foldmin_gap_datetimemax_gap_datetimemin_gap_zonemax_gap_zonemin_fold_datetimemax_fold_datetimemin_fold_zonemax_fold_zonestats_sincezonenamer   ry   r  trans_countss                           r#   statszZoneInfo.stats|  s   7888	8J&]*(!!(.6l:+&**|08<-(,,z1a00 	% 	%HQJEh''B^^-- % %	E##4<<NIr{g/?%@@@"''/+-(x|b01WhlM]>]4^^^"''/+-(T\\!OJ"FEr{h0A%BBB#((0,.)x|b01Xx|N_?_4```#((0,.)1$KK3%4 ":{;*U2333PL!!#l24 	5 	5 	5WWWW>N>N>NP\P\]^^^WWWW>N>N>NP\P\]^^^XXXX?P?P?PR_R_`aaaXXXX?P?P?PR_R_`aaaaar%   c              #      K   t          t          | j        | j                            D ]4\  \  }}\  }}|d         |d         z
  }t	          j        |          |fV  5d S rZ  )r  rk  r  r  r   r_  r1   _prev_tir   r  r  s         r#   r  zZoneInfo.transitions  ss      %*3tw+@+@%A%A 	6 	6!LQ'1bqEGAJ&E+A..55555	6 	6r%   c              #     K   	 t          t          | j        | j                            D ]`\  \  }}\  }}|d         |d         z
  }|t          k     r9|d         |d         k    r't          j        |          | |d         |d         fV  ad S )Nr   r&   rY   )r  rk  r  r  r   r   r_  r/  s         r#   nondst_foldszZoneInfo.nondst_folds  s      Z%*3tw+@+@%A%A 	N 	N!LQ'1bqEGAJ&Et||1 3 3/22UFGAJ1MMMM	N 	Nr%   Fc                     d}|                                  D ]d}|                     |          }|                                D ]8\  }}}}	|j        |k     s|r||	k    r|dz  }t	          d||||||	fz             9ed S )Nr   r&   z%3d) %-30s %s %10s %5s -> %s)r  r   r3  r_  r  )
rZ  	same_abbrr  r  r+  r   ry   r  	prev_abbrr  s
             r#   print_all_nondst_foldszZoneInfo.print_all_nondst_folds  s     	E 	EHh''B.0oo.?.? E E*E9d7Z''9'd9J9J
4hE9dCD E E E E	E	E 	Er%   c              #   b   K   |                                  D ]\  }}|t          k     r|| fV  d S r4   r  r   r1   r   r  s      r#   foldszZoneInfo.folds  sH      ((** 	  	 HAut||%i	  	 r%   c              #   `   K   |                                  D ]\  }}|t          k    r||fV  d S r4   r9  r:  s      r#   gapszZoneInfo.gaps  sF      ((** 	 	HAut||h	 	r%   c              #   J   K   |                                  D ]\  }}|s|V  d S r4   )r  r:  s      r#   zeroszZoneInfo.zeros  sA      ((** 	 	HAu 	 	r%   r4   )r&   )Fr&   )rK   rb   rc   r  rs   r  r  classmethodr  r   r   rh  r  r   r	  rz   r   r}   r  r-  r  r3  r7  r;  r=  r?  r   r%   r#   r  r    s       $H& & & 	 	 \	 " " ["H # # [#
 4a##--//L  <+ + +$ $ $' ' '$ $ $ * * * [* -b -b -b [-b`6 6 6
N N N 	E 	E 	E [	E     
  
    r%   r  c                   r    e Zd ZdZd Zd Zd Zd Z ej	         e
ed          d          d             Zd	S )
ZoneInfoTestzAmerica/New_Yorkc                 T   t           j        dk    r|                     d           t           j        dk    r|                     d           	 t                              | j                  | _        d S # t          $ r+}|                     d| j        d|           Y d }~d S d }~ww xY w)Nvxworksz"Skipping zoneinfo tests on VxWorksr  z"Skipping zoneinfo tests on Windowsz	Skipping z: )rI   rC  rL   r  r   r+  r   FileNotFoundError)r1   errs     r#   r   zZoneInfoTest.setUp  s    <9$$MM>???<7""MM>???	D''66DGGG  	D 	D 	DMMMt}}}ccBCCCCCCCCC	Ds   $A2 2
B'< B""B'c                     |                      |                    d           |j        t          |j                  f|                    d           |j        t          |j                  f           d S )Nr   )r0   r  r:  idr   )r1   rn  ro  s      r#   assertEquivDatetimesz!ZoneInfoTest.assertEquivDatetimes  sl    !))4)00!&"QX,,G))4)00!&"QX,,G	I 	I 	I 	I 	Ir%   c                    | j         }|                                D ]\  }}d|z  d|z  |t          j        z
  fD ]'}||z   }|                    |                    |                    }|                     |j        d           |                    t          j	                  
                    |          }|                     ||           |                                }|                     |                    d           ||z              |                     |
                    t          j	                  |                    t          j	                             )t          j         |fD ]M}||z   }|                    |          }|                    |          }|                     |j        d           Nd S )Nr   rc  r   r&   )r   r;  r   r  r   r  r0   r:  r   r6   r  rI  rz   	r1   r   ry   r  r  udtrw  adtrz   s	            r#   
test_foldszZoneInfoTest.test_folds  s   W 	. 	.IB%iuei6J.JK 
L 
L1fjjB!7!788  1---kkk66AA"EE))#s333MMOO	  D!9!93?KKK))#..*F*F*-++X\+*J*JL L L L !++U3 . .1fkkk,,jjoo  1----	.	. 	.r%   c                 8   | j         }|                                D ]\  }}d|z  d|z  |t          j        z
  fD ]}||z   }|                    |          }|                    |          }|                     |j        d           |                    t          j	                  
                    |          }|                     ||           |                                }|                     |                    d           |                    d           |z              |                    |                    |                    |z
  |z   }|                     |                    d                                          |                    d                                          d|z             t          j         |fD ]K}||z   }|                    |                    |                    }|                     |j        d           Ld S )Nr   rc  r   r&   r9  zAt %s.)r   r=  r   r  r  r   r0   r:  r   r6   r  rI  rz   
assertLessrK  s	            r#   	test_gapszZoneInfoTest.test_gaps  s   W 	. 	.IB%iuei6J.JK 0 01fkkk,,jjoo  1---kkk66AA"EE))#s333MMOO	  D!9!93;;d;;S;SV_;_```jj2!6!677%?!C 3 3 = = ? ? # 3 3 = = ? ? (30 0 0 0 !++U3 . .1fjjB!7!788  1----.!	. 	.r%   tzsetz"time module has no attribute tzsetc           	         d| j         v s| j                             d          r|                     d| j         z             | j        }t          j                            d          }| j         t          j        d<   	 t          j                     |	                                D ]e\  }}|j
        dk    r nS|t          ddd          z
  t          z  }|t          z  }dd	d
d|dz
  |dz   |dz   fD ]}||z   }t          j        |          }	t          j        ||                              d           }
|                     |	|
           |	                                }|                     ||           |dk    rt          j        |          |dz  z
  }|                                }|                    d                                          }|                     |||dz  z              |                     |||dz  z
             g|t          j        d= n|t          j        d<   t          j                     d S # |t          j        d= n|t          j        d<   t          j                     w xY w)NRiyadh8zright/zSkipping %sTZi  rO  r&   iir  r   i@ i2 r   rY   r9  )r+  rD   rL   r   r  environgetr  rR  r  r_  r   r  r  r  rI  r  r0   )r1   r   rU  rL  r  r  r"  r  r  sdttzdtr  ry   ts0ts1s                  r#   test_system_transitionsz$ZoneInfoTest.test_system_transitions  sb    && ((22 ' MM-$-7888WZ^^D!!=
4	KMMM nn.. 7 7
U8t## EHT1a000S8c\$hAq&"y."y.B , ,AQA"033C#1!R88@@@MMD--c4888B$$Q++++66!/33eai?B,,..C**!*,,6688C$$S"rAv+666$$S"rAv+666zJt$$#%
4 KMMMMM	 zJt$$#%
4 KMMMMs   <FH> >4I2N)rK   rb   rc   r+  r   rI  rN  rQ  rA  
skipUnlessr   r   r\  r   r%   r#   rB  rB    s        !HD D DI I I. . .,. . .. Xg D * * * * *r%   rB  c                        e Zd Z fdZ xZS )ZoneInfoCompleteTestc                 p   g }t          d          rt                                          D ]h}t          d|z  t          fi           }||_        t          |          D ]5}|                    d          r|                     ||                     6it                      
                    |           d S )NtzdatazZoneInfoTest[%s]test_)r   r  r  r   rB  r+  r:   rD   r  superrs   )r1   r  rF   TestmethodrJ   s        r#   rs   zZoneInfoCompleteTest.__init__D  s    x(( 	3 **,, 3 3.5KK $!$ii 3 3F((11 3TT&\\2223 	r%   )rK   rb   rc   rs   __classcell__)rJ   s   @r#   r_  r_  C  s8        	  	  	  	  	  	  	  	  	 r%   r_  c                       e Zd ZdZdS )IranTestzAsia/TehranN)rK   rb   rc   r+  r   r%   r#   rh  rh  P  s        HHHr%   rh  zneed _testcapi modulec                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )CapiTestc                     | j         j                            d          r|                     d           t	          j                     d S )NPurezNot relevant in pure Python)rJ   rK   rE   rL   	_testcapitest_datetime_capir7   s    r#   r   zCapiTest.setUpV  sG    >"++F33 	9MM7888 	$&&&&&r%   c                     dD ]d}t          j        |          }|                     |          5  |                     |t          j                   d d d            n# 1 swxY w Y   ed S )NTF)	use_macro)rm  get_timezone_utc_capir3  r5   r   r6   )r1   rq  capi_utcs      r#   test_utc_capizCapiTest.test_utc_capi_  s    & 	6 	6I 6yAAH	22 6 6h5556 6 6 6 6 6 6 6 6 6 6 6 6 6 6	6 	6s   !AA 	#A 	c           	         t          j                    \  }}}t          t          d          d          }t          t          d                    }d||fd||fd||fg}|D ]\  }}}	|                     |          5  |                     ||	           t          dd	d
|          }
t          dd	d
|	          }|                     |
|           |                     |
                                |                                           t          dd	d
dt          j                  }|                     |
	                    t          j                  |           d d d            n# 1 swxY w Y   d S )Nr  r   r   est_capi	est_macroest_macro_nn)rF   rS  rY   r[   r   rV   )
rm  make_timezones_capir   r   r3  r0   r   r}   r6   r  )r1   rv  rw  rx  	exp_namedexp_unnamedcasesrF   tz_acttz_expr   rT  r  s                r#   test_timezones_capizCapiTest.test_timezones_capif  s   ,5,I,K,K))\YR000%88	yr22233 9-)Y/\;7
 %* 	G 	G D&&4(( G G  000tQ&999tQ&999  c***  szz||<<<!$1aEEE  !=!=vFFFG G G G G G G G G G G G G G G	G 	Gs    CE**E.	1E.	c                     G d dt                     }t           |fD ]}dD ]} || }|                     ||          5  t          j        |          \  }}}|                     ||j                   |                     ||j                   |                     ||j                   d d d            n# 1 swxY w Y   d S )Nc                       e Zd ZdS )=CapiTest.test_PyDateTime_DELTA_GET.<locals>.TimeDeltaSubclassNr  r   r%   r#   TimeDeltaSubclassr    r  r%   r  )r   7   韆 r  rZ  r   )r   r3  rm  PyDateTime_DELTA_GETr0   rT  r   r   )r1   r  klassr   r  rT  r   r   s           r#   test_PyDateTime_DELTA_GETz"CapiTest.test_PyDateTime_DELTA_GET  sP   	 	 	 	 		 	 	 	  !23 	C 	CE: C CE4L\\e$\77 C C2;2PQR2S2S/D'<$$T16222$$Wai888$$\1>BBBC C C C C C C C C C C C C C CC	C 	C   A*B55B9<B9c                     G d dt                     }t           |fD ]}dD ]} || }|                     ||          5  t          j        |          \  }}}|                     ||j                   |                     ||j                   |                     ||j                   d d d            n# 1 swxY w Y   d S )Nc                       e Zd ZdS )2CapiTest.test_PyDateTime_GET.<locals>.DateSubclassNr  r   r%   r#   r  r    r  r%   r  ))rS  r&   rY   )rc  rY   r~  r  )r   r3  rm  PyDateTime_GETr0   r_  r`  r  )r1   r  r  r   r  r_  r`  r  s           r#   test_PyDateTime_GETzCapiTest.test_PyDateTime_GET  s6   	 	 	 	 	4 	 	 	 L) 	1 	1E5 1 1E4L\\e$\77 1 1'0'?'B'B$D%$$T16222$$UAG444$$S!%0001 1 1 1 1 1 1 1 1 1 1 1 1 1 11	1 	1r  c           
           G d dt                     }t           |fD ]}ddddddd	d
t          j        ffD ]} || }|                     ||          5  t	          j        |          \  }}}}}	|                     ||j                   |                     ||j                   |                     ||j	                   |                     ||j
                   |                     |	|j                   d d d            n# 1 swxY w Y   ،d S )Nc                       e Zd ZdS );CapiTest.test_PyDateTime_DATE_GET.<locals>.DateTimeSubclassNr  r   r%   r#   r  r    r  r%   r  )  r  r   r  r   r  r  r  r  r   r  r   r  r  r  )r   r   r6   r3  rm  PyDateTime_DATE_GETr0   rf  r  r  rj  r5   r   )
r1   r  r  r   r  rf  r  r  rj  r   s
             r#   test_PyDateTime_DATE_GETz!CapiTest.test_PyDateTime_DATE_GET  s   	 	 	 	 	x 	 	 	  01 	4 	4E92r2r5",() 4 4 E4L\\e$\77 4 4,5,I!,L,L >D&&+v $$T16222$$VQX666$$VQX666$$[!-@@@MM&!(3334 4 4 4 4 4 4 4 4 4 4 4 4 4 4	4	4 	4s   B"DDDc                     G d dt                     }t           |fD ]}dddddt          j        ffD ]} || }|                     ||          5  t	          j        |          \  }}}}}	|                     ||j                   |                     ||j                   |                     ||j	                   |                     ||j
                   |                     |	|j                   d d d            n# 1 swxY w Y   ،d S )	Nc                       e Zd ZdS )7CapiTest.test_PyDateTime_TIME_GET.<locals>.TimeSubclassNr  r   r%   r#   r  r    r  r%   r  )r   r  r<  r'   r   r  r<  r'   r  )r   r   r6   r3  rm  PyDateTime_TIME_GETr0   rf  r  r  rj  r5   r   )
r1   r  r  r   r  rf  r  r  rj  r   s
             r#   test_PyDateTime_TIME_GETz!CapiTest.test_PyDateTime_TIME_GET  s   	 	 	 	 	4 	 	 	 L) 	4 	4E)b"b(,79 4 4E4L\\e$\77 4 4.7.KA.N.N >D&&+v $$T16222$$VQX666$$VQX666$$[!-@@@MM&!(3334 4 4 4 4 4 4 4 4 4 4 4 4 4 44	4 	4s   B"C>>DDc                 ^   t          j                    \  }}}|                     d          5  |                     |t          j                   d d d            n# 1 swxY w Y   |                     d          5  |                     |t          j                   d d d            n# 1 swxY w Y   |                     d          5  |                     |t          j                   t	          t          d          d          }|                     ||           t          dd	d
|          }t          dd	d
|          }|                     ||           |                     |
                                |
                                           d d d            d S # 1 swxY w Y   d S )Nutc0)testnameutc1non_utcr   r   r  rS  rY   r[   r   )rm  get_timezones_offset_zeror3  r5   r   r6   r   r   r0   r   r}   )r1   r  r  r  non_utc_expr   rT  s          r#   test_timezones_offset_zeroz#CapiTest.test_timezones_offset_zero  sA   'ACCdG\\6\** 	. 	.MM$---	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. \\6\** 	. 	.MM$---	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. \\9\-- 	9 	9Whl333"91#5#5#5r::KWk2224Ag666C4Ak:::CS#&&&SZZ\\3::<<888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9s6   !AA"A<!B))B-0B-
CF""F&)F&c           
      L    G d dt                     }t          ddd          } |ddd          }t          ddd          }t          j        }|                      ||                     |                      ||                     |                      ||                     |                      ||d                     |                      ||d                     |                      ||d                     t                      t                      ddt          d          t          j
        t          dd          g}|D ]U}d	D ]P}|                     ||
          5  |                      |||                     d d d            n# 1 swxY w Y   QVd S )Nc                       e Zd ZdS ).CapiTest.test_check_date.<locals>.DateSubclassNr  r   r%   r#   r  r    r  r%   r    r&   T
2011-01-01r   r   rp  argexact)r   r   rm  datetime_check_dater   r   r  r  r   r   r6   r   r3  )	r1   r  r  dsry   is_dater   r  r  s	            r#   test_check_datezCapiTest.test_check_date  s   	 	 	 	 	4 	 	 	 q!\$1%%dAq!!/ 	

###$$$$$$4(())) 	T**+++T**+++ L!hlDRLL: 	: 	:C& : :\\c\77 : :$$WWS%%8%8999: : : : : : : : : : : : : : ::	: 	:s   + FFFc                     G d dt                     }t          dd          } |dd          }t          j        }|                      ||                     |                      ||                     |                      ||d                     |                      ||d                     t                      t                      ddt          d          t          j	        t          ddd          g}|D ]U}d	D ]P}|                     ||
          5  |                      |||                     d d d            n# 1 swxY w Y   QVd S )Nc                       e Zd ZdS ).CapiTest.test_check_time.<locals>.TimeSubclassNr  r   r%   r#   r  r    r  r%   r  r   r  Tr&   r  r  rp  r  )r   rm  datetime_check_timer   r   r  r  r   r   r6   r   r3  )r1   r  r   r  is_timer   r  r  s           r#   test_check_timezCapiTest.test_check_time  s   	 	 	 	 	4 	 	 	 RLL\"b!!/ 	

###$$$4(())) 	T**+++ L!hlDq!,<,<>  	: 	:C& : :\\c\77 : :$$WWS%%8%8999: : : : : : : : : : : : : : ::	: 	:    EEEc                     G d dt                     }t          ddddd          } |ddddd          }t          j        }|                      ||                     |                      ||                     |                      ||d                     |                      ||d                     t                      t                      ddt          d          t          j	        t          ddd          g}|D ]U}d	D ]P}|                     ||
          5  |                      |||                     d d d            n# 1 swxY w Y   QVd S )Nc                       e Zd ZdS )6CapiTest.test_check_datetime.<locals>.DateTimeSubclassNr  r   r%   r#   r  r    r  r%   r  r  r&   r   r  Tr  rp  r  )r   rm  datetime_check_datetimer   r   r  r  r   r   r6   r   r3  )r1   r  ry   r  is_datetimer   r  r  s           r#   test_check_datetimezCapiTest.test_check_datetime  s   	 	 	 	 	x 	 	 	 dAq"b))tQ2r227 	B(((C(()))B--... 	S$//000 L!hlDq!,<,<>  	> 	>C& > >\\c\77 > >$$[[e%<%<===> > > > > > > > > > > > > > >>	> 	>s   " EEEc                     G d dt                     }t          d          } |d          }t          j        }|                      ||                     |                      ||                     |                      ||d                     |                      ||d                     t                      t                      ddt          j        t          ddd          t          ddd          g}|D ]U}dD ]P}|                     ||          5  |                      |||                     d d d            n# 1 swxY w Y   QVd S )	Nc                       e Zd ZdS )4CapiTest.test_check_delta.<locals>.TimeDeltaSubclassNr  r   r%   r#   r  r  (  r  r%   r  r&   Tr  r  rp  r  )r   rm  datetime_check_deltar   r   r  r  r   r6   r   r   r3  )r1   r  r[  tdsis_timedeltar   r  r  s           r#   test_check_deltazCapiTest.test_check_delta'  s   	 	 	 	 		 	 	 	 q\\"" 5 	R(()))S))***R../// 	c400111 Ld4A..q!0D0DF  	? 	?C& ? ?\\c\77 ? ?$$\\#u%=%=>>>? ? ? ? ? ? ? ? ? ? ? ? ? ? ??	? 	?r  c           
      H    G d dt                     }t                      } |            }t          t          d                    }t          j        }|                      ||                     |                      ||                     |                      ||                     |                      ||d                     |                      ||d                     |                      ||d                     t                      t                      ddt          ddd          t          ddd          g}|D ]U}d	D ]P}|                     ||
          5  |                      |||                     d d d            n# 1 swxY w Y   QVd S )Nc                       e Zd ZdS )2CapiTest.test_check_tzinfo.<locals>.TZInfoSubclassNr  r   r%   r#   TZInfoSubclassr  B  r  r%   r  r  r   Tr&   r  r  rp  r  )r   r   r   rm  datetime_check_tzinfor   r   r  r  r   r   r3  )	r1   r  r  tzisr   	is_tzinfor   r  r  s	            r#   test_check_tzinfozCapiTest.test_check_tzinfoA  s   	 	 	 	 	V 	 	 	 hh~ib)))**3	 			#'''		"&&&		$(((		#t,,--- 	2t,,---4../// LT1a  (4A"6"68  	< 	<C& < <\\c\77 < <$$YYsE%:%:;;;< < < < < < < < < < < < < < <<	< 	<s   ) FFFc                    t          ddd          }dD ]l}|                     |          5  t          j        ||j        |j        |j                  }|                     ||           d d d            n# 1 swxY w Y   md S )Nr  r  r   FTmacro)r   r3  rm  get_date_fromdater_  r`  r  r0   r1   exp_dater  
c_api_dates       r#   test_date_from_datezCapiTest.test_date_from_date^  s    a$$  	7 	7EE** 7 7&8MNL	" "
   X6667 7 7 7 7 7 7 7 7 7 7 7 7 7 7	7 	7   =A55A9	<A9	c                 >   t          ddddddd          }dD ]}|                     |	          5  t          j        ||j        |j        |j        |j        |j        |j	        |j
                  }|                     ||           d d d            n# 1 swxY w Y   d S )
Nr  r  r   r  r   r  r  r  r  )r   r3  rm  get_datetime_fromdateandtimer_  r`  r  rf  r  r  rj  r0   r  s       r#   test_datetime_from_dateandtimez'CapiTest.test_datetime_from_dateandtimek  s    D!RRU;;  	7 	7EE** 7 7&CMNLMOO(* *
   X6667 7 7 7 7 7 7 7 7 7 7 7 7 7 7	7 	7s   ABB	B	c                    t          ddddddd          }dD ]}d	D ]}|                     ||
          5  t          j        ||j        |j        |j        |j        |j        |j	        |j
        |j        	  	        }|                     ||           |                     |j        |j                   d d d            n# 1 swxY w Y   d S )Nr  r  r   r  r   r  r  r   r&   r  r  r:  )r   r3  rm  #get_datetime_fromdateandtimeandfoldr_  r`  r  rf  r  r  rj  r:  r0   )r1   r  r:  r  r  s        r#   %test_datetime_from_dateandtimeandfoldz.CapiTest.test_datetime_from_dateandtimeandfold|  s<   D!RRU;; 	E 	ED$ E E\\D\99 E E!*!N       , 	"' 	"'J $$Z:::$$Z_hmDDDE E E E E E E E E E E E E E EE	E 	Es   A;B<<C C c           	         t          dddd          }dD ]r}|                     |          5  t          j        ||j        |j        |j        |j                  }|                     ||           d d d            n# 1 swxY w Y   sd S )Nr  r   r  r  r  r  )	r   r3  rm  get_time_fromtimerf  r  r  rj  r0   )r1   exp_timer  
c_api_times       r#   test_time_from_timezCapiTest.test_time_from_time  s    BE**  		7 		7EE** 7 7&8MOO(* *
   X6667 7 7 7 7 7 7 7 7 7 7 7 7 7 7		7 		7s   AA<<B 	B 	c                 l   t          dddd          }dD ]}dD ]}|                     ||          5  t          j        ||j        |j        |j        |j        |j                  }| 	                    ||           | 	                    |j        |j                   d d d            n# 1 swxY w Y   d S )Nr  r   r  r  r  r  r  )
r   r3  rm  get_time_fromtimeandfoldrf  r  r  rj  r:  r0   )r1   r  r:  r  r  s        r#   test_time_from_timeandfoldz#CapiTest.test_time_from_timeandfold  s'   BE** 	E 	ED$ E E\\D\99 
E 
E!*!C    , "' "'J $$Z:::$$Z_hmDDD
E 
E 
E 
E 
E 
E 
E 
E 
E 
E 
E 
E 
E 
E 
EE	E 	Es   A)B''B+.B+c                    t          ddd          }dD ]l}|                     |          5  t          j        ||j        |j        |j                  }|                     ||           d d d            n# 1 swxY w Y   md S )Nr   r  r  r  r  )r   r3  rm  get_delta_fromdsurT  r   r   r0   )r1   	exp_deltar  c_api_deltas       r#   test_delta_from_dsuzCapiTest.test_delta_from_dsu  s    b"e,,	  	9 	9EE** 9 9'9N%*	, ,   i8889 9 9 9 9 9 9 9 9 9 9 9 9 9 9	9 	9r  c           
      @   t          ddd                                          }dD ]w}|                     |          5  t          j        t          |          |          }|                     |t          ddd                     d d d            n# 1 swxY w Y   xd S )N  r[   r   r  r  )r   r  r3  rm  get_date_fromtimestamprl   r0   r   )r1   r  r  r  s       r#   test_date_from_timestampz!CapiTest.test_date_from_timestamp  s    dAr"",,..  	7 	7EE** 7 74SWWeDD  Dq"$5$56667 7 7 7 7 7 7 7 7 7 7 7 7 7 7	7 	7s   ABB	B	c                    dddt          t          d                    dfddd	t          t          d                    dfg}t          j        }|D ]}d
D ]}|                     ||          5  |\  }}}t          |d|i}t          |                                          }	 ||	|||          }
|                     ||
           d d d            n# 1 swxY w Y   d S )N)r  r[   r   NF)r  NTr  r&   r   T)r  r[   r   rd  r  NF)r  NTr  r  )caser  r   )	r   r   rm  get_datetime_fromtimestampr3  r   rl   r  r0   )r1   r|  r  r  r  dtupr   usetzdt_origr  r  s              r#   test_datetime_from_timestampz%CapiTest.test_datetime_from_timestamp  sT   ('HYQ%7%7%788$?0/"HYQ-?-?-?$@$@$G
 #= 		5 		5D$ 5 5\\t5\99 5 5*.'D&%&<V<<GW..0011B*N2vueDDE$$We4445 5 5 5 5 5 5 5 5 5 5 5 5 5 55		5 		5s   0ACCCN)rK   rb   rc   r   rt  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r%   r#   rj  rj  T  s[       ' ' '6 6 6G G G4C C C1 1 14 4 4&4 4 4$9 9 9,: : :8: : :4> > >4? ? ?4< < <:7 7 77 7 7"E E E(7 7 7E E E"9 9 97 7 75 5 5 5 5r%   rj  c                 H    |                     t                                 |S r4   )addTestr_  )loaderstandard_testspatterns      r#   
load_testsr    s#    /11222r%   __main__)pr  r  r  r   rl  	functoolsrI   r  r    r   r8  r  rA  r   operatorr   r   r   r   r   r	   r
   r   r   testr   test.supportr   r   r   r   r   r/   r   r   r   r   r   r   r   r   r  rm  ImportErrorr  r   _loadsr3  rl  rP  r   r  r-  r  r  TestCaser,   re   r   r   r   r   r   r:  rQ  rQ  rW  r\  r  r  rE  rI  rK  r  r  rL  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  rE  rq  rz  r  r  r  r  r  r  r  r  r  rB  	TestSuiter_  rh  rB  rj  r  rK   mainr   r%   r#   <module>r	     sq
   
			            



 				   				         C C C C C C C C C C C C C C C C C C C C C C       J J J J J J J J J J J J " " " " % % % % % % % %                               # # # # # # # #       III     fm,C C$uV%<q%@AAC C C $r2r*
 eElleEll5) 5) 5) 5) 5)" 5) 5) 5)v         &      &< < < < <; < < <
E E E E E$8 E E E    f   ^/ ^/ ^/ ^/ ^/" ^/ ^/ ^/B{D {D {D {D {D8$ {D {D {DB.7 .7 .7 .7 .7 .7 .7 .7fs s s s s+X-> s s sr) ) ) ) )8$ ) ) )B    4   z; z; z; z; z;&(9 z; z; z;@    x   N7 N7 N7 N7 N78 N7 N7 N7b(    <       4   G9 G9 G9 G9 G9&(9 G9 G9 G9X]4 ]4 ]4 ]4 ]4 ]4 ]4 ]4BWE WE WE WE WE:x'8 WE WE WExs
C s
C s
C s
C s
C\:x/@ s
C s
C s
Cn   y||	1			yqiQ8Aq!Q
 
!RQ		( ( ( ( ( ( ( (T :b)eU33:b)eU33:b*eU33:b)eU33;q%## ;vy!,,} } } } }h/ } } }FEO EO EO EO EOx  EO EO EOZ9 9 9 9 9f 9 9 9D1 1 1 1 1' 1 1 1f KJ66KJ66KK66	KJ66/ / / / /& / / /dOC OC OC OC OC("3 OC OC OCb i1oo  
c c c c cv c c cLk k k k k8$ k k k\
  
  
  
  
 8- 
  
  
     |    d"$;<<D5 D5 D5 D5 D5x  D5 D5 =<D5N  
 zHMOOOOO s   B   B*)B*