#NEWLINE# @ mock . patch . object ( pci_utils , 'get_ifname_by_pci_address' , return_value = 'fake-devname' ) #NEWLINE# def test_set_vif_host_backend_hw_veb_direct( self , mock_pci ) : #NEWLINE# #INDENT# conf = config . LibvirtConfigGuestInterface ( ) #NEWLINE# designer . set_vif_host_backend_hw_veb ( conf , 'direct' , 'fake-pci-dev' , 'fake-vlan' , 'fake-tap' ) #NEWLINE# self . assertEqual ( 'direct' , conf . net_type ) #NEWLINE# self . assertEqual ( 'fake-devname' , conf . source_dev ) #NEWLINE# self . assertEqual ( 'passthrough' , conf . source_mode ) #NEWLINE# self . assertEqual ( 'vhost' , conf . driver_name ) #NEWLINE# self . assertEqual ( 'fake-tap' , conf . target_dev ) #NEWLINE# mock_pci . assert_called_with ( 'fake-pci-dev' )