#NEWLINE# def testListInstance_NoFilter( self ) : #NEWLINE# #INDENT# 'Unit test of ListInstance() without filter string.' #NEWLINE# mock_api = MagicMock ( name = 'Mock Google Client API' ) #NEWLINE# self . gce_api . GetApi = MagicMock ( return_value = mock_api ) #NEWLINE# mock_api . instances . return_value . list . return_value . execute . return_value = { #NEWLINE# #INDENT# 'items' : [ 'dummy' , 'list' ] , #NEWLINE# #UNINDENT# } #NEWLINE# instance_list = self . gce_api . ListInstances ( ) #NEWLINE# self . assertEqual ( 1 , mock_api . gce_api . GetApi . call_count ) #NEWLINE# mock_api . instances . return_value . list . assert_called_once_with ( project = 'project-name' , zone = 'zone-name' , filter = None ) #NEWLINE# mock_api . instances . return_value . list . return_value . execute . assert_called_once_with ( ) #NEWLINE# self . assertEqual ( [ 'dummy' , 'list' ] , instance_list )