|
3 | 3 | """ |
4 | 4 | import unittest |
5 | 5 |
|
6 | | -import responses |
7 | | - |
8 | 6 | from botocore.stub import Stubber |
9 | 7 |
|
10 | 8 | from secgrp_updater import main |
@@ -168,66 +166,6 @@ def test_unknown_boto3_errors_cause_no_processing(self): |
168 | 166 | self.assertEqual(0, len(result)) |
169 | 167 | self.stubber.assert_no_pending_responses() |
170 | 168 |
|
171 | | - # @responses.activate |
172 | | - # def test_update_sec_groups(self): |
173 | | - # """ |
174 | | - # Test the actual run function to know if security groups have been updated |
175 | | - # """ |
176 | | - # responses.add( |
177 | | - # responses.GET, |
178 | | - # 'https://api.github.com/meta', |
179 | | - # json={'hooks': self.allowed_ranges} |
180 | | - # ) |
181 | | - |
182 | | - # mock_describe_response = { |
183 | | - # 'SecurityGroups': [self.managed_sg, self.managed_sg_2] |
184 | | - # } |
185 | | - # expected_describe_params = {'GroupNames': [self.default_managed_group_name]} |
186 | | - # self.stubber.add_response( |
187 | | - # 'describe_security_groups', |
188 | | - # mock_describe_response, |
189 | | - # expected_describe_params |
190 | | - # ) |
191 | | - |
192 | | - # expected_update_params_1 = { |
193 | | - # 'GroupId': f'sg-{self.managed_id}', |
194 | | - # 'IpPermissions': [ |
195 | | - # { |
196 | | - # 'FromPort': 443, |
197 | | - # 'ToPort': 443, |
198 | | - # 'IpProtocol': 'tcp', |
199 | | - # 'IpRanges': [{'CidrIp': ip_range} for ip_range in self.allowed_ranges] |
200 | | - # } |
201 | | - # ] |
202 | | - # } |
203 | | - # expected_update_params_2 = { |
204 | | - # 'GroupId': f'sg-{self.managed_id_2}', |
205 | | - # 'IpPermissions': [ |
206 | | - # { |
207 | | - # 'FromPort': 443, |
208 | | - # 'ToPort': 443, |
209 | | - # 'IpProtocol': 'tcp', |
210 | | - # 'IpRanges': [{'CidrIp': ip_range} for ip_range in self.allowed_ranges] |
211 | | - # } |
212 | | - # ] |
213 | | - # } |
214 | | - |
215 | | - # self.stubber.add_response( |
216 | | - # 'update_security_group_rule_descriptions_ingress', |
217 | | - # {}, |
218 | | - # expected_update_params_1 |
219 | | - # ) |
220 | | - # self.stubber.add_response( |
221 | | - # 'update_security_group_rule_descriptions_ingress', |
222 | | - # {}, |
223 | | - # expected_update_params_2 |
224 | | - # ) |
225 | | - |
226 | | - # with self.stubber: |
227 | | - # main.run([f'vpc-{self.managed_id}', f'vpc-{self.managed_id_2}']) |
228 | | - |
229 | | - # self.stubber.assert_no_pending_responses() |
230 | | - |
231 | 169 | def test_update_security_group_adds_rules(self): |
232 | 170 | """ Test update_security_group adds correct rules """ |
233 | 171 | self.stubber.add_response( |
|
0 commit comments