
    %`                     `    d dl Z d dlZd dlmZmZmZ d Zd Zd Zd Z	d Z
d Zd	 Zd
 Zd ZdS )    N)datetime_nowdatetime_to_strstr_to_datetimec                      t           j                                         } t          t          |                     t          u sJ d S )N)datetimenowtyper   strdts    :/usr/lib/python3/dist-packages/ceph/tests/test_datetime.pytest_datetime_to_str_1r      s=    					 	 B##$$++++++    c                      t           j                             dd                              t           j        j                  } t          |           dk    sJ d S )Nz2019-04-24T17:06:53.039991z%Y-%m-%dT%H:%M:%S.%f)tzinfoz2019-04-24T17:06:53.039991Z)r   strptimereplacetimezoneutcr   r   s    r   test_datetime_to_str_2r      s\    			#	#$
 
 gX&*g++  2"???????r   c                  p    t           j                             dd          } t          |           dk    sJ d S )Nz2020-11-02T04:40:12.748172-0800z%Y-%m-%dT%H:%M:%S.%f%zz2020-11-02T12:40:12.748172Z)r   r   r   r   s    r   test_datetime_to_str_3r      s@    			#	#$E$<
> 
>B2"???????r   c                  p    t          d          } t          |           t          j        u sJ | j        J d S Nz2020-03-03T09:21:43.636153304Zr   r	   r   r   r   s    r   test_str_to_datetime_1r      s>    	9	:	:B88x(((((9     r   c                  p    t          d          } t          |           t          j        u sJ | j        J d S )Nz"2020-03-03T15:52:30.136257504-0600r   r   s    r   test_str_to_datetime_2r   "   s>    	=	>	>B88x(((((9     r   c                  p    t          d          } t          |           t          j        u sJ | j        J d S )Nz2020-03-03T15:52:30.136257504r   r   s    r   test_str_to_datetime_3r    (   s>    	8	9	9B88x(((((9     r   c                      t          j        t                    5  t          d           d d d            d S # 1 swxY w Y   d S )Nz2020-03-03 15:52:30.136257504pytestraises
ValueErrorr    r   r   %test_str_to_datetime_invalid_format_1r'   .   s    	z	"	" 9 978889 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9   7;;c                      t          j        t                    5  t          d           d d d            d S # 1 swxY w Y   d S )Nz
2020-03-03r"   r&   r   r   %test_str_to_datetime_invalid_format_2r*   3   s    	z	"	" & &%%%& & & & & & & & & & & & & & & & & &r(   c                      t          d          } t                      }t          |          t          j        u sJ |j        J | |k     sJ d S r   )r   r   r	   r   r   )r   dt_nows     r   test_datetime_now_1r-   8   sR    	9	:	:B^^F<<8,,,,,=$$$;;;;;;r   )r   r#   
ceph.utilsr   r   r   r   r   r   r   r   r    r'   r*   r-   r&   r   r   <module>r/      s      E E E E E E E E E E, , ,
@ @ @@ @ @! ! !! ! !! ! !9 9 9
& & &
    r   