

def test_delete_hosting_device_not_in_use_succeeds(self):
    ctx = n_context.get_admin_context()
    with self.hosting_device_template() as hdt:
        hdt_id = hdt['hosting_device_template']['id']
        with self.port(subnet=self._mgmt_subnet) as mgmt_port:
            mgmt_port_id = mgmt_port['port']['id']
            with req.hosting_device(template_id=hdt_id, management_port_id=mgmt_port_id, no_delete=True) as hd:
                hd_id = hd['hosting_device']['id']
                req = self.new_delete_request('hosting_devices', hd_id)
                res = req.get_response(self.ext_api)
                self.assertEqual(204, res.status_int)
                self.assertRaises(ciscohostingdevicemanager.HostingDeviceNotFound, self.plugin.get_hosting_device, ctx, hd_id)

dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/tests/unit/cisco/device_manager/test_db_device_manager.py TestDeviceManagerDBPlugin.test_delete_hosting_device_not_in_use_succeeds/VarMisuse@66/115 `self`->`req`