|
9 | 9 |
|
10 | 10 | from utils_for_tests.mock_environment_variables import ( |
11 | 11 | MOCK_ENVIRONMENT_DICT, |
12 | | - BucketNames, |
13 | 12 | ) |
14 | 13 | from utils_for_tests.utils_for_filenameprocessor_tests import ( |
15 | 14 | GenericSetUp, |
|
20 | 19 | with patch.dict("os.environ", MOCK_ENVIRONMENT_DICT): |
21 | 20 | from common.clients import REGION_NAME |
22 | 21 | from constants import AUDIT_TABLE_TTL_DAYS |
23 | | - from utils_for_filenameprocessor import get_creation_and_expiry_times, move_file |
| 22 | + from utils_for_filenameprocessor import get_creation_and_expiry_times |
24 | 23 |
|
25 | 24 | s3_client = boto3_client("s3", region_name=REGION_NAME) |
26 | 25 |
|
@@ -50,20 +49,3 @@ def test_get_creation_and_expiry_times(self): |
50 | 49 |
|
51 | 50 | self.assertEqual(created_at_formatted_string, expected_result_created_at) |
52 | 51 | self.assertEqual(expires_at, expected_result_expires_at) |
53 | | - |
54 | | - def test_move_file(self): |
55 | | - """Tests that move_file correctly moves a file from one location to another within a single S3 bucket""" |
56 | | - source_file_key = "test_file_key" |
57 | | - destination_file_key = "destination/test_file_key" |
58 | | - source_file_content = "test_content" |
59 | | - s3_client.put_object(Bucket=BucketNames.SOURCE, Key=source_file_key, Body=source_file_content) |
60 | | - |
61 | | - move_file(BucketNames.SOURCE, source_file_key, destination_file_key) |
62 | | - |
63 | | - keys_of_objects_in_bucket = [ |
64 | | - obj["Key"] for obj in s3_client.list_objects_v2(Bucket=BucketNames.SOURCE).get("Contents") |
65 | | - ] |
66 | | - self.assertNotIn(source_file_key, keys_of_objects_in_bucket) |
67 | | - self.assertIn(destination_file_key, keys_of_objects_in_bucket) |
68 | | - destination_file_content = s3_client.get_object(Bucket=BucketNames.SOURCE, Key=destination_file_key) |
69 | | - self.assertEqual(destination_file_content["Body"].read().decode("utf-8"), source_file_content) |
0 commit comments