#NEWLINE# def test_iscsi_get_host_iqn( self ) : #NEWLINE# #INDENT# host_mor = mock . Mock ( ) #NEWLINE# iqn = 'iscsi-name' #NEWLINE# hba = vmwareapi_fake . HostInternetScsiHba ( iqn ) #NEWLINE# hbas = mock . MagicMock ( HostHostBusAdapter = [ hba ] ) #NEWLINE# with test . nested ( mock . patch . object ( vm_util , 'get_host_ref_for_vm' , return_value = host_mor ) , mock . patch . object ( self . _volumeops . _session , '_call_method' , return_value = hbas ) ) as ( fake_get_host_ref_for_vm , fake_call_method ) : #NEWLINE# #INDENT# result = self . _volumeops . _iscsi_get_host_iqn ( self . _instance ) #NEWLINE# fake_get_host_ref_for_vm . assert_called_once_with ( self . _volumeops . _session , self . _instance ) #NEWLINE# fake_call_method . assert_called_once_with ( vutil , 'get_object_property' , host_mor , 'config.storageDevice.hostBusAdapter' ) #NEWLINE# self . assertEqual ( iqn , result )