'Mock treat devices added or updated.
:param details: the details to return for the device
:param port: the port that get_vif_port_by_id should return
:param func_name: the function that should be called
:returns: whether the named function was called'

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': []}):
        with mock.patch.object(self.agent.int_br, 'get_vifs_by_ids', return_value={details['device']: port}):
            with mock.patch.object(self.agent.plugin_rpc, 'update_device_list', return_value={'devices_up': [], 'devices_down': details, 'failed_devices_up': [], 'failed_devices_down': []}):
                with mock.patch.object(self.agent.int_br, 'get_port_tag_dict', return_value={}):
                    with mock.patch.object(self.agent, func_name) as func:
                        (skip_devs, need_bound_devices, _) = self.agent.treat_devices_added_or_updated([], False)
                        self.assertFalse(skip_devs)
                        return func.called
