Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Windows path error in S3 testcases #593

Merged
merged 23 commits into from
Feb 23, 2023
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions test/integration_tests/test_s3_load_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.
import os
import unittest
from pathlib import Path
from test.util import create_dummy_batches, create_sample_video, file_remove

import boto3
Expand Down Expand Up @@ -82,7 +83,9 @@ def test_s3_single_file_load_executor(self):
actual_batch = execute_query_fetch_all(select_query)
actual_batch.sort()
expected_batch = list(
create_dummy_batches(video_dir=f"{self.s3_download_dir}/MyVideo")
create_dummy_batches(
video_dir=os.path.join(self.s3_download_dir, "MyVideo")
)
)[0]
self.assertEqual(actual_batch, expected_batch)
execute_query_fetch_all("DROP TABLE IF EXISTS MyVideo;")
Expand Down Expand Up @@ -114,12 +117,15 @@ def test_s3_multiple_file_multiple_load_executor(self):

select_query = """SELECT * FROM MyVideos;"""
result = execute_query_fetch_all(select_query)
result_videos = list(result.frames["myvideos.name"].unique())
result_videos = [
Path(video).as_posix() for video in result.frames["myvideos.name"].unique()
]

s3_dir_path = Path(self.s3_download_dir)
expected_videos = [
self.s3_download_dir + "/MyVideos/1.mp4",
self.s3_download_dir + "/MyVideos/2.mp4",
self.video_file_path,
(s3_dir_path / "MyVideos/1.mp4").as_posix(),
(s3_dir_path / "MyVideos/2.mp4").as_posix(),
Path(self.video_file_path).as_posix(),
]

self.assertEqual(result_videos, expected_videos)
Expand Down