From: Salvatore Orlando Date: Mon, 13 Jan 2014 11:33:40 +0000 (-0800) Subject: Fix negative unit test for sec group rules X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=45557c43e4f8e42a98c09deb45739bebaa5b8507;p=openstack-build%2Fneutron-build.git Fix negative unit test for sec group rules Ensure the test fails because the security group rule could not be created, and not because the security group was deleted before creating the rule. Closes-Bug: #1268561 Change-Id: Ib2ea8c4507862d7bb343ce5181cf018b3cdf4b73 --- diff --git a/neutron/tests/unit/test_extension_security_group.py b/neutron/tests/unit/test_extension_security_group.py index eec1e3d2c..16fe3902a 100644 --- a/neutron/tests/unit/test_extension_security_group.py +++ b/neutron/tests/unit/test_extension_security_group.py @@ -738,9 +738,11 @@ class TestSecurityGroups(SecurityGroupDBTestCase): 'port_range_max': '22', 'tenant_id': "bad_tenant"}} - res = self._create_security_group_rule(self.fmt, rule) - self.deserialize(self.fmt, res) - self.assertEqual(res.status_int, webob.exc.HTTPNotFound.code) + res = self._create_security_group_rule(self.fmt, rule, + tenant_id='bad_tenant', + set_context=True) + self.deserialize(self.fmt, res) + self.assertEqual(res.status_int, webob.exc.HTTPNotFound.code) def test_create_security_group_rule_bad_tenant_remote_group_id(self): with self.security_group() as sg: