|
10 | 10 | import pytest |
11 | 11 | from botocore.exceptions import ClientError |
12 | 12 | from click.testing import CliRunner |
13 | | -from moto import mock_ec2, mock_s3 |
| 13 | +from moto import mock_aws |
14 | 14 |
|
15 | 15 | from scripts.user_retirement.retirement_archive_and_cleanup import ( |
16 | 16 | ERR_ARCHIVING, |
@@ -89,7 +89,7 @@ def fake_learners_to_retire(): |
89 | 89 | get_learners_by_date_and_status=DEFAULT, |
90 | 90 | bulk_cleanup_retirements=DEFAULT |
91 | 91 | ) |
92 | | -@mock_s3 |
| 92 | +@mock_aws |
93 | 93 | def test_successful(*args, **kwargs): |
94 | 94 | conn = boto3.resource('s3') |
95 | 95 | conn.create_bucket(Bucket=FAKE_BUCKET_NAME) |
@@ -118,8 +118,7 @@ def test_successful(*args, **kwargs): |
118 | 118 | get_learners_by_date_and_status=DEFAULT, |
119 | 119 | bulk_cleanup_retirements=DEFAULT |
120 | 120 | ) |
121 | | -@mock_ec2 |
122 | | -@mock_s3 |
| 121 | +@mock_aws |
123 | 122 | def test_successful_with_batching(*args, **kwargs): |
124 | 123 | conn = boto3.resource('s3') |
125 | 124 | conn.create_bucket(Bucket=FAKE_BUCKET_NAME) |
@@ -149,7 +148,7 @@ def test_successful_with_batching(*args, **kwargs): |
149 | 148 | get_learners_by_date_and_status=DEFAULT, |
150 | 149 | bulk_cleanup_retirements=DEFAULT |
151 | 150 | ) |
152 | | -@mock_s3 |
| 151 | +@mock_aws |
153 | 152 | def test_successful_dry_run(*args, **kwargs): |
154 | 153 | mock_get_access_token = args[0] |
155 | 154 | mock_get_learners = kwargs['get_learners_by_date_and_status'] |
@@ -253,7 +252,7 @@ def test_conflicting_cool_off_date(*_): |
253 | 252 | assert 'End date cannot occur within the cool_off_days period' in result.output |
254 | 253 |
|
255 | 254 |
|
256 | | -@mock_s3 |
| 255 | +@mock_aws |
257 | 256 | def test_s3_upload_data(): |
258 | 257 | """ |
259 | 258 | Test case to verify s3 upload and download. |
|
0 commit comments