|
4 | 4 | from unittest.mock import patch |
5 | 5 |
|
6 | 6 | import boto3 |
7 | | -from botocore.exceptions import ClientError |
8 | 7 | from moto import mock_aws |
9 | 8 |
|
10 | 9 | from common import aws_s3_utils |
@@ -117,45 +116,3 @@ def test_move_file_outside_bucket_copies_then_deletes(self): |
117 | 116 | # Assert source object was deleted |
118 | 117 | with self.assertRaises(self.s3.exceptions.NoSuchKey): |
119 | 118 | self.s3.get_object(Bucket=self.source_bucket, Key=source_key) |
120 | | - |
121 | | - def test_is_file_in_bucket(self): |
122 | | - """File should be present in destination bucket""" |
123 | | - file_key = "src/move_file_test.csv" |
124 | | - |
125 | | - # Put an object in the source bucket |
126 | | - body_content = b"dummy file content" |
127 | | - self.s3.put_object(Bucket=self.source_bucket, Key=file_key, Body=body_content) |
128 | | - |
129 | | - # Should raise no exception |
130 | | - aws_s3_utils.is_file_in_bucket( |
131 | | - bucket_name=self.source_bucket, |
132 | | - file_key=file_key, |
133 | | - ) |
134 | | - |
135 | | - def test_is_file_not_in_bucket(self): |
136 | | - """File should not be present in source bucket""" |
137 | | - file_key = "src/move_file_test.csv" |
138 | | - |
139 | | - # Don't put the object in the source bucket |
140 | | - |
141 | | - # Should raise an exception |
142 | | - with self.assertRaises(ClientError): |
143 | | - aws_s3_utils.is_file_in_bucket( |
144 | | - bucket_name=self.source_bucket, |
145 | | - file_key=file_key, |
146 | | - ) |
147 | | - |
148 | | - def test_is_file_in_wrong_bucket(self): |
149 | | - """File should not be present in destination bucket""" |
150 | | - file_key = "src/move_file_test.csv" |
151 | | - |
152 | | - # Put an object in the source bucket |
153 | | - body_content = b"dummy file content" |
154 | | - self.s3.put_object(Bucket=self.source_bucket, Key=file_key, Body=body_content) |
155 | | - |
156 | | - # Should raise an exception |
157 | | - with self.assertRaises(ClientError): |
158 | | - aws_s3_utils.is_file_in_bucket( |
159 | | - bucket_name=self.destination_bucket, |
160 | | - file_key=file_key, |
161 | | - ) |
0 commit comments