#NEWLINE# def test_set_device_status_mismatch( self ) : #NEWLINE# #INDENT# with mock . patch ( 'neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_pci_device' , return_value = self . ASSIGNED_MAC ) , mock . patch ( 'neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.set_device_state' ) : #NEWLINE# #INDENT# with mock . patch ( 'neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.LOG.warning' ) as log_mock : #NEWLINE# #INDENT# self . eswitch_mgr . set_device_state ( log_mock . WRONG_MAC , self . PCI_SLOT , True ) #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# } )