Skip to content

Commit 846ebf7

Browse files
committed
also improve test file to make sure it is compatible with windows platform
1 parent d2010d0 commit 846ebf7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/integ/test_direct_file_operation_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _validate_upload_content(
2727
):
2828
gz_suffix = ".gz"
2929
stage_path = f"@{stage_name}/{base_file_name}"
30-
local_path = f"{local_dir}/{base_file_name}"
30+
local_path = os.path.join(local_dir, base_file_name)
3131

3232
cursor.execute(
3333
f"GET ? 'file://{local_dir}'", params=[stage_path], _force_qmark_paramstyle=True
@@ -90,7 +90,7 @@ def test_upload(
9090
):
9191
def upload_task(cursor, stage_name, temp_dir, base_file_name):
9292
cursor._upload(
93-
local_file_name=f"file://{temp_dir}/{base_file_name}",
93+
local_file_name=f"file://{os.path.join(temp_dir, base_file_name)}",
9494
stage_location=f"@{stage_name}",
9595
options={"auto_compress": is_compressed},
9696
)
@@ -105,10 +105,10 @@ def test_upload_stream(
105105
is_compressed: bool,
106106
):
107107
def upload_stream_task(cursor, stage_name, temp_dir, base_file_name):
108-
with open(f"{temp_dir}/{base_file_name}", "rb") as input_stream:
108+
with open(f"{os.path.join(temp_dir, base_file_name)}", "rb") as input_stream:
109109
cursor._upload_stream(
110110
input_stream=input_stream,
111-
stage_location=f"@{stage_name}/{base_file_name}",
111+
stage_location=f"@{os.path.join(stage_name, base_file_name)}",
112112
options={"auto_compress": is_compressed},
113113
)
114114

0 commit comments

Comments
 (0)