

def test_hosting_device_template_policy(self):
    with self.hosting_device_template() as hdt:
        hdt_id = hdt['hosting_device_template']['id']
        tenant_id = hdt['hosting_device_template']['tenant_id']
        self._create_hosting_device_template(self.fmt, 'my_template', True, 'Hardware', webob.exc.HTTPForbidden.code, tenant_id=tenant_id, set_context=True)
        non_admin_ctx = n_context.Context('', tenant_id)
        self._show('hosting_device_templates', hdt_id, webob.exc.HTTPNotFound.code, non_admin_ctx)
        self._update('hosting_device_templates', hdt_id, {
            'hosting_device_template': {
                'enabled': False,
            },
        }, webob.exc.HTTPForbidden.code, non_admin_ctx)
        self._delete('hosting_device_templates', hdt_id, webob.exc.HTTPNotFound.code, non_admin_ctx)

dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/tests/unit/cisco/device_manager/test_db_device_manager.py TestDeviceManagerDBPlugin.test_hosting_device_template_policy/original