Skip to content

Commit

Permalink
fix for windows
Browse files Browse the repository at this point in the history
Signed-off-by: Yee <[email protected]>
  • Loading branch information
wild-endeavor committed Mar 10, 2023
1 parent 1149b7c commit e9674e3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/flytekit/unit/core/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,20 @@ def test_local_provider_get_empty():
assert len(dest_files) == 0


@mock.patch("flytekit.configuration.get_config_file")
@mock.patch("os.environ")
def test_s3_setup_args_env_empty(mock_os):
def test_s3_setup_args_env_empty(mock_os, mock_get_config_file):
mock_get_config_file.return_value = None
mock_os.get.return_value = None
s3c = S3Config.auto()
kwargs = s3_setup_args(s3c)
assert kwargs == {}


@mock.patch("flytekit.configuration.get_config_file")
@mock.patch("os.environ")
def test_s3_setup_args_env_both(mock_os):
def test_s3_setup_args_env_both(mock_os, mock_get_config_file):
mock_get_config_file.return_value = None
ee = {
"AWS_ACCESS_KEY_ID": "ignore-user",
"AWS_SECRET_ACCESS_KEY": "ignore-secret",
Expand All @@ -184,8 +188,10 @@ def test_s3_setup_args_env_both(mock_os):
assert kwargs == {"key": "flyte", "secret": "flyte-secret"}


@mock.patch("flytekit.configuration.get_config_file")
@mock.patch("os.environ")
def test_s3_setup_args_env_flyte(mock_os):
def test_s3_setup_args_env_flyte(mock_os, mock_get_config_file):
mock_get_config_file.return_value = None
ee = {
"FLYTE_AWS_ACCESS_KEY_ID": "flyte",
"FLYTE_AWS_SECRET_ACCESS_KEY": "flyte-secret",
Expand All @@ -195,8 +201,10 @@ def test_s3_setup_args_env_flyte(mock_os):
assert kwargs == {"key": "flyte", "secret": "flyte-secret"}


@mock.patch("flytekit.configuration.get_config_file")
@mock.patch("os.environ")
def test_s3_setup_args_env_aws(mock_os):
def test_s3_setup_args_env_aws(mock_os, mock_get_config_file):
mock_get_config_file.return_value = None
ee = {
"AWS_ACCESS_KEY_ID": "ignore-user",
"AWS_SECRET_ACCESS_KEY": "ignore-secret",
Expand Down

0 comments on commit e9674e3

Please sign in to comment.