

def _assign_hosting_device_to_cfg_agent(self, cfg_agent_id, hosting_device_id, expected_code=exc.HTTPCreated.code, admin_context=True):
    path = ('/agents/%s/%s.%s' % (cfg_agent_id, ciscocfgagentscheduler.CFG_AGENT_HOSTING_DEVICES, self.fmt))
    req = self._path_create_request(path, {
        'hosting_device_id': hosting_device_id,
    }, admin_context=admin_context)
    res = req.get_response(self.ext_api)
    self.assertEqual(expected_code, res.status_int)

dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/tests/unit/cisco/device_manager/test_hosting_device_cfg_agent_scheduler.py HostingDeviceCfgAgentSchedulerTestMixIn._assign_hosting_device_to_cfg_agent/original