#NEWLINE# def test_ptime( self ) : #NEWLINE# #INDENT# with mock . patch ( 'time.gmtime' ) as mock_gmtime : #NEWLINE# #INDENT# mock_gmtime . return_value = time . struct_time ( ( 2013 , 12 , 17 , 10 , 0 , 0 , 1 , 351 , 0 ) ) #NEWLINE# timestamp = self . recon_instance . _ptime ( 1387274400 ) #NEWLINE# self . assertEqual ( timestamp , '2013-12-17 10:00:00' ) #NEWLINE# mock_gmtime . assert_called_with ( 1387274400 ) #NEWLINE# timestamp2 = self . recon_instance . _ptime ( ) #NEWLINE# self . assertEqual ( timestamp , '2013-12-17 10:00:00' ) #NEWLINE# mock_gmtime . assert_called_with ( )