#NEWLINE# @ istest #NEWLINE# def gets_last_update_date( self ) : #NEWLINE# #INDENT# with self . mock_role_methods ( 'remote_exists' , 'update_date_file' , 'read_remote_file' ) : #NEWLINE# #INDENT# self . role . update_date_file = '/foo/bar' #NEWLINE# self . role . remote_exists . return_value = True #NEWLINE# self . role . read_remote_file . return_value = '01-01-13 00:00:00' #NEWLINE# result = self . role . get_last_update_date ( ) #NEWLINE# self . assertEqual ( result , datetime . strptime ( '2013-01-01' , '%Y-%m-%d' ) ) #NEWLINE# self . role . remote_exists . assert_called_once_with ( self . role . update_date_file ) #NEWLINE# self . role . read_remote_file . assert_called_once_with ( self . role . update_date_file )