]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Redundant SG rule create calls in unit tests
authorsridhargaddam <sridhar.gaddam@enovance.com>
Thu, 3 Apr 2014 17:59:37 +0000 (23:29 +0530)
committerMark McClain <mmcclain@yahoo-inc.com>
Fri, 4 Apr 2014 22:37:19 +0000 (18:37 -0400)
This patch removes the redundant calls in the test cases.

Closes-Bug: #1302091
Change-Id: I509843b427dc454c0e6b2fd2cbff1bbbb284337f
(cherry picked from commit c49ec8b3ba10bb414a0f135d29ff3685e26d58b3)

neutron/tests/unit/test_extension_security_group.py

index 0f4926560959fa63d3b8c21b876caa1047664915..1881d8c848436c088b5871a3f5b6cde11bc52291 100644 (file)
@@ -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)