

def _create_hosting_device_template(self, fmt, name, enabled, host_category, expected_res_status=None, **kwargs):
    data = {
        'hosting_device_template': self._get_test_hosting_device_template_attr(name=name, enabled=enabled, host_category=host_category, **kwargs),
    }
    hdt_req = self.new_create_request('hosting_device_templates', data, fmt)
    if (kwargs.get('set_context') and ('tenant_id' in kwargs)):
        hdt_req.environ['neutron.context'] = n_context.Context('', kwargs['tenant_id'])
    hdt_res = hdt_req.get_response(self.ext_api)
    if expected_res_status:
        self.assertEqual(expected_res_status, hdt_res.status_int)
    return hdt_res

dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/tests/unit/cisco/device_manager/test_db_device_manager.py DeviceManagerTestCaseMixin._create_hosting_device_template/original