From: sridhargaddam Date: Thu, 3 Apr 2014 17:59:37 +0000 (+0530) Subject: Redundant SG rule create calls in unit tests X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=354bc1ab4b1490b72abf80cfd2860337f1ccb369;p=openstack-build%2Fneutron-build.git Redundant SG rule create calls in unit tests This patch removes the redundant calls in the test cases. Closes-Bug: #1302091 Change-Id: I509843b427dc454c0e6b2fd2cbff1bbbb284337f (cherry picked from commit c49ec8b3ba10bb414a0f135d29ff3685e26d58b3) --- diff --git a/neutron/tests/unit/test_extension_security_group.py b/neutron/tests/unit/test_extension_security_group.py index 0f4926560..1881d8c84 100644 --- a/neutron/tests/unit/test_extension_security_group.py +++ b/neutron/tests/unit/test_extension_security_group.py @@ -824,7 +824,6 @@ class TestSecurityGroups(SecurityGroupDBTestCase): rule = self._build_security_group_rule( sg['security_group']['id'], 'ingress', protocol, '50', '22') - self._create_security_group_rule(self.fmt, rule) res = self._create_security_group_rule(self.fmt, rule) self.deserialize(self.fmt, res) self.assertEqual(res.status_int, @@ -838,7 +837,6 @@ class TestSecurityGroups(SecurityGroupDBTestCase): with self.security_group_rule(security_group_id): rule = self._build_security_group_rule( sg['security_group']['id'], 'ingress', None, '22', '22') - self._create_security_group_rule(self.fmt, rule) res = self._create_security_group_rule(self.fmt, rule) self.deserialize(self.fmt, res) self.assertEqual(res.status_int, webob.exc.HTTPBadRequest.code) @@ -852,7 +850,6 @@ class TestSecurityGroups(SecurityGroupDBTestCase): rule = self._build_security_group_rule( sg['security_group']['id'], 'ingress', const.PROTO_NAME_TCP, '22', None) - self._create_security_group_rule(self.fmt, rule) res = self._create_security_group_rule(self.fmt, rule) self.deserialize(self.fmt, res) self.assertEqual(res.status_int, webob.exc.HTTPBadRequest.code) @@ -866,7 +863,6 @@ class TestSecurityGroups(SecurityGroupDBTestCase): rule = self._build_security_group_rule( sg['security_group']['id'], 'ingress', const.PROTO_NAME_TCP, None, '22') - self._create_security_group_rule(self.fmt, rule) res = self._create_security_group_rule(self.fmt, rule) self.deserialize(self.fmt, res) self.assertEqual(res.status_int, webob.exc.HTTPBadRequest.code) @@ -880,7 +876,6 @@ class TestSecurityGroups(SecurityGroupDBTestCase): rule = self._build_security_group_rule( sg['security_group']['id'], 'ingress', const.PROTO_NAME_ICMP, '256', None) - self._create_security_group_rule(self.fmt, rule) res = self._create_security_group_rule(self.fmt, rule) self.deserialize(self.fmt, res) self.assertEqual(res.status_int, webob.exc.HTTPBadRequest.code) @@ -894,7 +889,6 @@ class TestSecurityGroups(SecurityGroupDBTestCase): rule = self._build_security_group_rule( sg['security_group']['id'], 'ingress', const.PROTO_NAME_ICMP, '8', '256') - self._create_security_group_rule(self.fmt, rule) res = self._create_security_group_rule(self.fmt, rule) self.deserialize(self.fmt, res) self.assertEqual(res.status_int, webob.exc.HTTPBadRequest.code)