#NEWLINE# def test_get_device_status_mismatch( self ) : #NEWLINE# #INDENT# with mock . patch ( 'neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_pci_device' , return_value = log_mock . ASSIGNED_MAC ) , mock . patch ( 'neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_device_state' , return_value = True ) : #NEWLINE# #INDENT# with mock . patch ( 'neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.LOG.warning' ) as log_mock : #NEWLINE# #INDENT# result = self . eswitch_mgr . get_device_state ( self . WRONG_MAC , self . PCI_SLOT ) #NEWLINE# log_mock . assert_called_with ( 'device pci mismatch: %(device_mac)s - %(pci_slot)s' , { #NEWLINE# #INDENT# 'pci_slot' : self . PCI_SLOT , #NEWLINE# 'device_mac' : self . WRONG_MAC , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertFalse ( result )