From b68b9089fb005539b906a6b264dce76009857dc7 Mon Sep 17 00:00:00 2001 From: jwong-nd Date: Wed, 6 Nov 2024 12:04:08 -0800 Subject: [PATCH] lint the test --- .../__init__.py | 2 +- tests/test_transform_videos.py | 27 ++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/aind_behavior_video_transformation/__init__.py b/src/aind_behavior_video_transformation/__init__.py index 62a9247..9b4339a 100644 --- a/src/aind_behavior_video_transformation/__init__.py +++ b/src/aind_behavior_video_transformation/__init__.py @@ -9,5 +9,5 @@ from aind_behavior_video_transformation.transform_videos import ( # noqa F401 CompressionEnum, CompressionRequest, - convert_video + convert_video, ) diff --git a/tests/test_transform_videos.py b/tests/test_transform_videos.py index dfa5653..cc7e905 100644 --- a/tests/test_transform_videos.py +++ b/tests/test_transform_videos.py @@ -15,7 +15,7 @@ BehaviorVideoJobSettings, CompressionEnum, CompressionRequest, - convert_video + convert_video, ) @@ -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 @@ -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)