def _mock_treat_devices_added_updated(self, details, port, func_name):
        with mock.patch.object(self.agent.plugin_rpc,
                               'get_devices_details_list_and_failed_devices',
                               return_value={'devices': [details],
                                             'failed_devices': []}),\
                mock.patch.object(self.agent.int_br,
                                  'get_vifs_by_ids',
                                  return_value={details['device']: port}),\
                mock.patch.object(self.agent.plugin_rpc, 'update_device_list',
                                  return_value={'devices_up': [],
                                                'devices_down': details,
                                                'failed_devices_up': [],
                                                'failed_devices_down': []}),\
                mock.patch.object(self.agent.int_br,
                    'get_port_tag_dict',
                    return_value={}),\
                mock.patch.object(self.agent, func_name) as func:
            skip_devs, need_bound_devices, insecure_ports, _ = (
                self.agent.treat_devices_added_or_updated([], False))
            # The function should not raise
            self.assertFalse(skip_devs)
            return func.called
Mock treat devices added or updated.
dataset/ETHPy150Open openstack/neutron/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py/TestOvsNeutronAgent._mock_treat_devices_added_updated