Add exception validation for subnet used.

As a result of bug 1093754 there was no validation of the actual
exception returned.

Change-Id: Ia3104ca523d30ea40c354afa62ed5ce2b88d5b7e
This commit is contained in:
Gary Kotton 2013-01-14 10:01:20 +00:00
parent a2ad647b12
commit eafd5bf906

View File

@ -2052,10 +2052,13 @@ class TestSubnetsV2(QuantumDbPluginV2TestCase):
def test_delete_subnet_port_exists_owned_by_other(self): def test_delete_subnet_port_exists_owned_by_other(self):
with self.subnet() as subnet: with self.subnet() as subnet:
with self.port(subnet=subnet) as port: with self.port(subnet=subnet) as port:
req = self.new_delete_request('subnets', id = subnet['subnet']['id']
subnet['subnet']['id']) req = self.new_delete_request('subnets', id)
res = req.get_response(self.api) res = req.get_response(self.api)
data = self.deserialize('json', res)
self.assertEqual(res.status_int, 409) self.assertEqual(res.status_int, 409)
msg = str(q_exc.SubnetInUse(subnet_id=id))
self.assertEqual(data['QuantumError'], msg)
def test_delete_network(self): def test_delete_network(self):
gateway_ip = '10.0.0.1' gateway_ip = '10.0.0.1'