
    uki	                         d Z ddlZddlmZ ddlmZ ej                  Z G d dej                        Ze	dk(  r ej                          yy)z9Tests for mediapipe.python._framework_bindings.timestamp.    N)absltest)	timestampc                   0    e Zd Zd Zd Zd Zd Zd Zd Zy)TimestampTestc                     t        d      }| j                  |j                  d       | j                  |d       | j                  t        |      d       y )Nd   z%<mediapipe.Timestamp with value: 100>)	TimestampassertEqualvaluestr)selfts     Z/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/mediapipe/python/timestamp_test.pytest_timestampzTimestampTest.test_timestamp   sD    #AQWWc"QSVDE    c                 T    t        d      }t        |      }| j                  ||       y )Nr   )r	   r
   r   ts1ts2s      r   test_timestamp_copy_constructorz-TimestampTest.test_timestamp_copy_constructor"   s$    
C.C
C.CS#r   c                     t        d      }t        d      }| j                  ||       t        d      }| j                  ||       y )Nr      )r	   r
   assertNotEqual)r   r   r   ts3s       r   test_timestamp_comparsionz'TimestampTest.test_timestamp_comparsion'   s=    
C.C
C.CS#
C.CS!r   c                 ^   t         j                  }| j                  t        |      d       t         j                  }| j                  t        |      d       t         j
                  }| j                  t        |      d       t         j                  }| j                  t        |      d       t         j                  }| j                  t        |      d       t         j                  }| j                  t        |      d       t         j                  }| j                  t        |      d       y )Nz'<mediapipe.Timestamp with value: UNSET>z+<mediapipe.Timestamp with value: UNSTARTED>z+<mediapipe.Timestamp with value: PRESTREAM>z%<mediapipe.Timestamp with value: MIN>z%<mediapipe.Timestamp with value: MAX>z,<mediapipe.Timestamp with value: POSTSTREAM>z&<mediapipe.Timestamp with value: DONE>)
r	   UNSETr
   r   	UNSTARTED	PRESTREAMMINMAX
POSTSTREAMDONE)r   t1t2t3t4t5t6t7s           r   test_timestamp_special_valuesz+TimestampTest.test_timestamp_special_values.   s    	BSWGH			BSWKL			BSWKL	BSWEF	BSWEF			BSWLM	BSWFGr   c                     t        d      }t        d      }| j                  ||       | j                  ||       | j                  ||       | j	                  ||       | j                  ||       y )Nr   e   )r	   assertGreaterassertGreaterEqual
assertLessassertLessEqualr   r   s      r   test_timestamp_comparisonsz(TimestampTest.test_timestamp_comparisons>   sb    
C.C
C.CsC C%OOCc"S!r   c                     t        j                          }t        j                  |      }| j                  ||j	                         d       y )N   )delta)timer	   from_secondsassertAlmostEqualseconds)r   nowtss      r   test_from_secondszTimestampTest.test_from_secondsG   s8    
))+C				$B3

A6r   N)	__name__
__module____qualname__r   r   r   r+   r2   r<    r   r   r   r      s"    F
"H "7r   r   __main__)__doc__r6   absl.testingr   $mediapipe.python._framework_bindingsr   r	   TestCaser   r=   mainr@   r   r   <module>rG      sL    @  ! :	07H%% 07f z(--/ r   