Skip to content

Commit

Permalink
lint the test
Browse files Browse the repository at this point in the history
  • Loading branch information
jwong-nd committed Nov 6, 2024
1 parent b70512f commit b68b908
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/aind_behavior_video_transformation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
from aind_behavior_video_transformation.transform_videos import ( # noqa F401
CompressionEnum,
CompressionRequest,
convert_video
convert_video,
)
27 changes: 15 additions & 12 deletions tests/test_transform_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
BehaviorVideoJobSettings,
CompressionEnum,
CompressionRequest,
convert_video
convert_video,
)


Expand Down Expand Up @@ -58,18 +58,21 @@ def test_convert_video(self, mock_time: MagicMock):
"""Unit test convert video."""

# Equivalent to CompressionEnum.GAMMA_ENCODING
arg_set = ("", "-vf "
'"scale=out_color_matrix=bt709:out_range=full:sws_dither=none,'
"format=yuv420p10le,colorspace=ispace=bt709:all=bt709:dither=none,"
'scale=out_range=tv:sws_dither=none,format=yuv420p" -c:v libx264 '
"-preset veryslow -crf 18 -pix_fmt yuv420p "
'-metadata author="Allen Institute for Neural Dyamics" '
"-movflags +faststart+write_colr")
arg_set = (
"",
"-vf "
'"scale=out_color_matrix=bt709:out_range=full:sws_dither=none,'
"format=yuv420p10le,colorspace=ispace=bt709:all=bt709:dither=none,"
'scale=out_range=tv:sws_dither=none,format=yuv420p" -c:v libx264 '
"-preset veryslow -crf 18 -pix_fmt yuv420p "
'-metadata author="Allen Institute for Neural Dyamics" '
"-movflags +faststart+write_colr",
)
with tempfile.TemporaryDirectory() as temp_dir:
temp_path = Path(temp_dir)
compressed_out_path = convert_video(self.test_vid_path,
temp_path,
arg_set)
compressed_out_path = convert_video(
self.test_vid_path, temp_path, arg_set
)

out_path = temp_path / self.test_vid_name

Expand All @@ -96,7 +99,7 @@ def test_run_job(self, mock_time: MagicMock):
compression_requested=CompressionRequest(
compression_enum=compression_enum
),
parallel_compression=False
parallel_compression=False,
)
response = helper_run_compression_job(job_settings, mock_time)
self.assertEqual(expected_response, response)
Expand Down

0 comments on commit b68b908

Please sign in to comment.