Skip to content

Commit 44af5de

Browse files
committed
Fixing aws tests.
1 parent ed42279 commit 44af5de

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/tests_transfers/aws/aws_test_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,23 @@ def setup_aws_connection(project: DataShuttle):
3434
The `AWS_SECRET_ACCESS_KEY` is set in the environment by the CI while
3535
testing. For testing locally, the developer must set it themselves.
3636
"""
37+
38+
def mock_input(_: str) -> str:
39+
return "y"
40+
41+
import builtins
42+
43+
original_input = copy.deepcopy(builtins.input)
44+
builtins.input = mock_input # type: ignore
45+
3746
original_get_secret = copy.deepcopy(aws.get_aws_secret_access_key)
3847
aws.get_aws_secret_access_key = lambda *args, **kwargs: os.environ[
3948
"AWS_SECRET_ACCESS_KEY"
4049
]
4150

4251
project.setup_aws_connection()
4352

53+
builtins.input = original_input
4454
aws.get_aws_secret_access_key = original_get_secret
4555

4656

0 commit comments

Comments
 (0)