def _test_dhcp_api(self, method, **kwargs):
        ctxt = context.get_admin_context()
        proxy = dhcp_agent.DhcpPluginApi('foo', ctxt, host='foo')

        with mock.patch.object(proxy.client, 'call') as rpc_mock,\
                mock.patch.object(proxy.client, 'prepare') as prepare_mock:
            prepare_mock.return_value = proxy.client
            rpc_mock.return_value = kwargs.pop('return_value', [])

            prepare_args = {}
            if kwargs in 'version':
                prepare_args['version'] = kwargs.pop('version')

            retval = getattr(proxy, method)(**kwargs)
            self.assertEqual(retval, rpc_mock.return_value)

            prepare_mock.assert_called_once_with(**prepare_args)
            kwargs['host'] = proxy.host
            rpc_mock.assert_called_once_with(ctxt, method, **kwargs)
dataset/ETHPy150Open openstack/neutron/neutron/tests/unit/agent/dhcp/test_agent.py/TestDhcpPluginApiProxy._test_dhcp_api/swapped operands of `in`