|
6 | 6 |
|
7 | 7 |
|
8 | 8 | class TestConnectors(BaseTest):
|
| 9 | + def tearDown(self): |
| 10 | + # Some tests will create items in S3 Bucket, which result in stack DELETE_FAILED state |
| 11 | + # manually empty the bucket to allow stacks to be deleted successfully. |
| 12 | + bucket_name = self.get_physical_id_by_type("AWS::S3::Bucket") |
| 13 | + if bucket_name: |
| 14 | + clean_bucket(bucket_name, self.client_provider.s3_client) |
| 15 | + super().tearDown() |
| 16 | + |
9 | 17 | @parameterized.expand(
|
10 | 18 | [
|
11 | 19 | ("combination/connector_function_to_function",),
|
@@ -50,12 +58,6 @@ def test_connector_by_invoking_a_function(self, template_file_path):
|
50 | 58 | self.assertEqual(response.get("StatusCode"), 200)
|
51 | 59 | self.assertEqual(response.get("FunctionError"), None)
|
52 | 60 |
|
53 |
| - # Some tests will create items in S3 Bucket, which result in stack DELETE_FAILED state |
54 |
| - # manually empty the bucket to allow stacks to be deleted successfully. |
55 |
| - bucket_name = self.get_physical_id_by_type("AWS::S3::Bucket") |
56 |
| - if bucket_name: |
57 |
| - clean_bucket(bucket_name, s3_client) |
58 |
| - |
59 | 61 | @parameterized.expand(
|
60 | 62 | [
|
61 | 63 | ("combination/connector_sfn_to_table_read",),
|
@@ -84,12 +86,6 @@ def test_connector_by_sync_execute_an_state_machine(self, template_file_path):
|
84 | 86 | # Without permission, it will be "FAILED"
|
85 | 87 | self.assertEqual(response.get("status"), "SUCCEEDED")
|
86 | 88 |
|
87 |
| - # Some tests will create items in S3 Bucket, which result in stack DELETE_FAILED state |
88 |
| - # manually empty the bucket to allow stacks to be deleted successfully. |
89 |
| - bucket_name = self.get_physical_id_by_type("AWS::S3::Bucket") |
90 |
| - if bucket_name: |
91 |
| - clean_bucket(bucket_name, s3_client) |
92 |
| - |
93 | 89 | @parameterized.expand(
|
94 | 90 | [
|
95 | 91 | ("combination/connector_sfn_to_sfn_sync",),
|
@@ -146,8 +142,3 @@ def test_connector_by_execute_a_s3_bucket(self, template_file_path):
|
146 | 142 | response = lambda_client.invoke(**request_params)
|
147 | 143 | self.assertEqual(response.get("StatusCode"), 200)
|
148 | 144 | self.assertEqual(response.get("FunctionError"), None)
|
149 |
| - |
150 |
| - # Some tests will create items in S3 Bucket, which result in stack DELETE_FAILED state |
151 |
| - # manually empty the bucket to allow stacks to be deleted successfully. |
152 |
| - bucket_name = self.get_physical_id_by_type("AWS::S3::Bucket") |
153 |
| - clean_bucket(bucket_name, s3_client) |
0 commit comments