Skip to content

Commit fad8e02

Browse files
black linter code correction
1 parent 536e4f0 commit fad8e02

23 files changed

+649
-412
lines changed

tests/validation/functional/cluster/video/test_ffmpeg_video.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_cluster_ffmpeg_video(hosts, media_proxy, test_config, video_type: str)
9999

100100
mcm_rx_executor.start()
101101
mcm_tx_executor.start()
102-
mcm_rx_executor.stop(wait = test_config.get("test_time_sec", 0.0))
103-
mcm_tx_executor.stop(wait = test_config.get("test_time_sec", 0.0))
102+
mcm_rx_executor.stop(wait=test_config.get("test_time_sec", 0.0))
103+
mcm_tx_executor.stop(wait=test_config.get("test_time_sec", 0.0))
104104

105105
# TODO: check if the output file exists and is > 0 bytes

tests/validation/functional/local/audio/test_audio_25_03.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818

1919

2020
@pytest.mark.parametrize("file", audio_files_25_03.keys())
21-
def test_audio_25_03(build_TestApp, hosts, media_proxy, media_path, file, log_path) -> None:
21+
def test_audio_25_03(
22+
build_TestApp, hosts, media_proxy, media_path, file, log_path
23+
) -> None:
2224

2325
# Get TX and RX hosts
2426
host_list = list(hosts.values())
2527
if len(host_list) < 1:
2628
pytest.skip("Local tests require at least 1 host")
2729
tx_host = rx_host = host_list[0]
28-
30+
2931
tx_executor = utils.LapkaExecutor.Tx(
3032
host=tx_host,
3133
media_path=media_path,

tests/validation/functional/local/audio/test_ffmpeg_audio.py

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,31 @@ def test_local_ffmpeg_audio(media_proxy, hosts, test_config, audio_type: str) ->
3333
tx_host = rx_host = host_list[0]
3434
tx_prefix_variables = test_config["tx"].get("prefix_variables", None)
3535
rx_prefix_variables = test_config["rx"].get("prefix_variables", None)
36-
tx_prefix_variables["MCM_MEDIA_PROXY_PORT"] = tx_host.topology.extra_info.media_proxy["sdk_port"]
37-
rx_prefix_variables["MCM_MEDIA_PROXY_PORT"] = rx_host.topology.extra_info.media_proxy["sdk_port"]
36+
tx_prefix_variables["MCM_MEDIA_PROXY_PORT"] = (
37+
tx_host.topology.extra_info.media_proxy["sdk_port"]
38+
)
39+
rx_prefix_variables["MCM_MEDIA_PROXY_PORT"] = (
40+
rx_host.topology.extra_info.media_proxy["sdk_port"]
41+
)
3842

39-
audio_format = audio_file_format_to_format_dict(str(audio_files[audio_type]["format"])) # audio format
43+
audio_format = audio_file_format_to_format_dict(
44+
str(audio_files[audio_type]["format"])
45+
) # audio format
4046
audio_channel_layout = audio_files[audio_type].get(
4147
"channel_layout",
42-
audio_channel_number_to_layout(int(audio_files[audio_type]["channels"]))
48+
audio_channel_number_to_layout(int(audio_files[audio_type]["channels"])),
4349
)
4450

4551
if audio_files[audio_type]["sample_rate"] not in [48000, 44100, 96000]:
46-
raise Exception(f"Not expected audio sample rate of {audio_files[audio_type]['sample_rate']}!")
52+
raise Exception(
53+
f"Not expected audio sample rate of {audio_files[audio_type]['sample_rate']}!"
54+
)
4755

4856
# >>>>> MCM Tx
4957
mcm_tx_inp = FFmpegAudioIO(
50-
ar = int(audio_files[audio_type]['sample_rate']),
51-
f = audio_format["ffmpeg_f"],
52-
ac = int(audio_files[audio_type]["channels"]),
58+
f=audio_format["ffmpeg_f"],
59+
ac=int(audio_files[audio_type]["channels"]),
60+
ar=int(audio_files[audio_type]["sample_rate"]),
5361
stream_loop = False,
5462
input_path = f'{test_config["tx"]["filepath"]}{audio_files[audio_type]["filename"]}'
5563
)
@@ -78,24 +86,24 @@ def test_local_ffmpeg_audio(media_proxy, hosts, test_config, audio_type: str) ->
7886
input_path = "-",
7987
)
8088
mcm_rx_outp = FFmpegAudioIO(
81-
f = audio_format["ffmpeg_f"],
82-
ac = int(audio_files[audio_type]["channels"]),
83-
ar = int(audio_files[audio_type]["sample_rate"]),
84-
channel_layout = audio_channel_layout,
85-
output_path = f'{test_config["rx"]["filepath"]}test_{audio_files[audio_type]["filename"]}'
89+
f=audio_format["ffmpeg_f"],
90+
ac=int(audio_files[audio_type]["channels"]),
91+
ar=int(audio_files[audio_type]["sample_rate"]),
92+
channel_layout=audio_channel_layout,
93+
output_path=f'{test_config["rx"]["filepath"]}test_{audio_files[audio_type]["filename"]}',
8694
)
8795
mcm_rx_ff = FFmpeg(
88-
prefix_variables= rx_prefix_variables,
89-
ffmpeg_path = test_config["rx"]["ffmpeg_path"],
90-
ffmpeg_input = mcm_rx_inp,
91-
ffmpeg_output = mcm_rx_outp,
92-
yes_overwrite = True,
96+
prefix_variables=rx_prefix_variables,
97+
ffmpeg_path=test_config["rx"]["ffmpeg_path"],
98+
ffmpeg_input=mcm_rx_inp,
99+
ffmpeg_output=mcm_rx_outp,
100+
yes_overwrite=True,
93101
)
94102

95103
logger.debug(f"Rx command: {mcm_rx_ff.get_command()}")
96-
mcm_rx_executor = FFmpegExecutor(rx_host, ffmpeg_instance = mcm_rx_ff)
104+
mcm_rx_executor = FFmpegExecutor(rx_host, ffmpeg_instance=mcm_rx_ff)
97105

98106
mcm_rx_executor.start()
99107
mcm_tx_executor.start()
100-
mcm_rx_executor.stop(wait = test_config.get("test_time_sec", 0.0))
101-
mcm_tx_executor.stop(wait = test_config.get("test_time_sec", 0.0))
108+
mcm_rx_executor.stop(wait=test_config.get("test_time_sec", 0.0))
109+
mcm_tx_executor.stop(wait=test_config.get("test_time_sec", 0.0))

tests/validation/functional/local/blob/test_blob_25_03.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020

2121
@pytest.mark.parametrize("file", [file for file in blob_files_25_03.keys()])
22-
def test_blob_25_03(build_TestApp, hosts, media_proxy, media_path, file, log_path) -> None:
22+
def test_blob_25_03(
23+
build_TestApp, hosts, media_proxy, media_path, file, log_path
24+
) -> None:
2325

2426
# Get TX and RX hosts
2527
host_list = list(hosts.values())

tests/validation/functional/local/video/test_ffmpeg_video.py

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
from ....Engine.media_files import yuv_files
1212

1313
from common.ffmpeg_handler.ffmpeg import FFmpeg, FFmpegExecutor
14-
from common.ffmpeg_handler.ffmpeg_enums import video_file_format_to_payload_format, McmConnectionType
14+
from common.ffmpeg_handler.ffmpeg_enums import (
15+
video_file_format_to_payload_format,
16+
McmConnectionType,
17+
)
1518

1619
from common.ffmpeg_handler.ffmpeg_io import FFmpegVideoIO
1720
from common.ffmpeg_handler.mcm_ffmpeg import FFmpegMcmMemifVideoIO
@@ -29,69 +32,75 @@ def test_local_ffmpeg_video(media_proxy, hosts, test_config, video_type: str) ->
2932
tx_host = rx_host = host_list[0]
3033
tx_prefix_variables = test_config["tx"].get("prefix_variables", None)
3134
rx_prefix_variables = test_config["rx"].get("prefix_variables", None)
32-
tx_prefix_variables["MCM_MEDIA_PROXY_PORT"] = tx_host.topology.extra_info.media_proxy["sdk_port"]
33-
rx_prefix_variables["MCM_MEDIA_PROXY_PORT"] = rx_host.topology.extra_info.media_proxy["sdk_port"]
35+
tx_prefix_variables["MCM_MEDIA_PROXY_PORT"] = (
36+
tx_host.topology.extra_info.media_proxy["sdk_port"]
37+
)
38+
rx_prefix_variables["MCM_MEDIA_PROXY_PORT"] = (
39+
rx_host.topology.extra_info.media_proxy["sdk_port"]
40+
)
3441

3542
frame_rate = str(yuv_files[video_type]["fps"])
3643
video_size = f'{yuv_files[video_type]["width"]}x{yuv_files[video_type]["height"]}'
37-
pixel_format = video_file_format_to_payload_format(str(yuv_files[video_type]["file_format"]))
44+
pixel_format = video_file_format_to_payload_format(
45+
str(yuv_files[video_type]["file_format"])
46+
)
3847
conn_type = McmConnectionType.mpg.value
3948

4049
# >>>>> MCM Tx
4150
mcm_tx_inp = FFmpegVideoIO(
42-
framerate = frame_rate,
43-
video_size = video_size,
44-
pixel_format = pixel_format,
45-
stream_loop = False,
46-
input_path = f'{test_config["tx"]["filepath"]}{yuv_files[video_type]["filename"]}'
51+
framerate=frame_rate,
52+
video_size=video_size,
53+
pixel_format=pixel_format,
54+
stream_loop=False,
55+
input_path=f'{test_config["tx"]["filepath"]}{yuv_files[video_type]["filename"]}',
4756
)
4857
mcm_tx_outp = FFmpegMcmMemifVideoIO(
49-
f = "mcm",
50-
conn_type = conn_type,
51-
frame_rate = frame_rate,
52-
video_size = video_size,
53-
pixel_format = pixel_format,
54-
output_path = "-",
58+
f="mcm",
59+
conn_type=conn_type,
60+
frame_rate=frame_rate,
61+
video_size=video_size,
62+
pixel_format=pixel_format,
63+
output_path="-",
5564
)
5665
mcm_tx_ff = FFmpeg(
57-
prefix_variables= tx_prefix_variables,
58-
ffmpeg_path = test_config["tx"]["ffmpeg_path"],
59-
ffmpeg_input = mcm_tx_inp,
60-
ffmpeg_output = mcm_tx_outp,
61-
yes_overwrite = False,
66+
prefix_variables=tx_prefix_variables,
67+
ffmpeg_path=test_config["tx"]["ffmpeg_path"],
68+
ffmpeg_input=mcm_tx_inp,
69+
ffmpeg_output=mcm_tx_outp,
70+
yes_overwrite=False,
6271
)
6372

6473
logger.debug(f"Tx command: {mcm_tx_ff.get_command()}")
65-
mcm_tx_executor = FFmpegExecutor(tx_host, ffmpeg_instance = mcm_tx_ff)
74+
mcm_tx_executor = FFmpegExecutor(tx_host, ffmpeg_instance=mcm_tx_ff)
6675

6776
# >>>>> MCM Rx
6877
mcm_rx_inp = FFmpegMcmMemifVideoIO(
69-
f = "mcm",
70-
conn_type = conn_type,
71-
frame_rate = frame_rate,
72-
video_size = video_size,
73-
pixel_format = pixel_format,
74-
input_path = "-",
78+
f="mcm",
79+
conn_type=conn_type,
80+
frame_rate=frame_rate,
81+
video_size=video_size,
82+
pixel_format=pixel_format,
83+
input_path="-",
7584
)
7685
mcm_rx_outp = FFmpegVideoIO(
77-
f = "rawvideo",
78-
framerate = frame_rate,
79-
video_size = video_size,
80-
pixel_format = pixel_format,
81-
output_path = f'{test_config["rx"]["filepath"]}test_{yuv_files[video_type]["filename"]}'
86+
f="rawvideo",
87+
framerate=frame_rate,
88+
video_size=video_size,
89+
pixel_format=pixel_format,
90+
output_path=f'{test_config["rx"]["filepath"]}test_{yuv_files[video_type]["filename"]}',
8291
)
8392
mcm_rx_ff = FFmpeg(
84-
prefix_variables= rx_prefix_variables,
85-
ffmpeg_path = test_config["rx"]["ffmpeg_path"],
86-
ffmpeg_input = mcm_rx_inp,
87-
ffmpeg_output = mcm_rx_outp,
88-
yes_overwrite = True,
93+
prefix_variables=rx_prefix_variables,
94+
ffmpeg_path=test_config["rx"]["ffmpeg_path"],
95+
ffmpeg_input=mcm_rx_inp,
96+
ffmpeg_output=mcm_rx_outp,
97+
yes_overwrite=True,
8998
)
9099

91100
logger.debug(f"Rx command: {mcm_rx_ff.get_command()}")
92-
mcm_rx_executor = FFmpegExecutor(rx_host, ffmpeg_instance = mcm_rx_ff)
101+
mcm_rx_executor = FFmpegExecutor(rx_host, ffmpeg_instance=mcm_rx_ff)
93102

94103
mcm_rx_executor.start()
95104
mcm_tx_executor.start()
96-
mcm_rx_executor.stop(wait = test_config.get("test_time_sec", 0.0))
97-
mcm_tx_executor.stop(wait = test_config.get("test_time_sec", 0.0))
105+
mcm_rx_executor.stop(wait=test_config.get("test_time_sec", 0.0))
106+
mcm_tx_executor.stop(wait=test_config.get("test_time_sec", 0.0))

tests/validation/functional/local/video/test_video_25_03.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020

2121
@pytest.mark.parametrize("file", [file for file in video_files_25_03.keys()])
22-
def test_video_25_03(build_TestApp, hosts, media_proxy, media_path, file, log_path) -> None:
22+
def test_video_25_03(
23+
build_TestApp, hosts, media_proxy, media_path, file, log_path
24+
) -> None:
2325

2426
# Get TX and RX hosts
2527
host_list = list(hosts.values())

tests/validation/functional/st2110/st20/test_3_2_st2110_standalone_video.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ def test_3_2_st2110_standalone_video(hosts, test_config, video_type, log_path):
5858

5959
fps = str(yuv_files[video_type]["fps"])
6060
size = f"{yuv_files[video_type]['width']}x{yuv_files[video_type]['height']}"
61-
pixel_format = video_file_format_to_payload_format(yuv_files[video_type]["file_format"])
61+
pixel_format = video_file_format_to_payload_format(
62+
yuv_files[video_type]["file_format"]
63+
)
6264

6365
rx_ffmpeg_input = FFmpegMtlSt20pRx(
6466
video_size=size,
@@ -78,7 +80,9 @@ def test_3_2_st2110_standalone_video(hosts, test_config, video_type, log_path):
7880
)
7981
rx_ffmpeg_output = FFmpegVideoIO(
8082
video_size=size,
81-
pixel_format="yuv422p10le" if pixel_format == "yuv422p10rfc4175" else pixel_format,
83+
pixel_format=(
84+
"yuv422p10le" if pixel_format == "yuv422p10rfc4175" else pixel_format
85+
),
8286
f=FFmpegVideoFormat.raw.value,
8387
output_path=f'{test_config["rx"]["filepath"]}test_{yuv_files[video_type]["filename"]}_{size}at{yuv_files[video_type]["fps"]}fps.yuv',
8488
pix_fmt=None,

tests/validation/functional/st2110/st20/test_4_1_RxTxApp_mcm_to_mtl_video_multiple_nodes.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,21 @@
1313
from common.ffmpeg_handler.ffmpeg import FFmpeg, FFmpegExecutor
1414
from common.ffmpeg_handler.ffmpeg_enums import (
1515
FFmpegVideoFormat,
16-
video_file_format_to_payload_format)
16+
video_file_format_to_payload_format,
17+
)
1718
from common.ffmpeg_handler.ffmpeg_io import FFmpegVideoIO
1819
from common.ffmpeg_handler.mtl_ffmpeg import FFmpegMtlSt20pRx
1920
from common.nicctl import Nicctl
2021
from Engine.const import (
21-
DEFAULT_LOOP_COUNT, DEFAULT_REMOTE_IP_ADDR, DEFAULT_REMOTE_PORT, DEFAULT_PACING,
22-
DEFAULT_PAYLOAD_TYPE_ST2110_20, DEFAULT_PIXEL_FORMAT,
23-
MCM_ESTABLISH_TIMEOUT, MTL_ESTABLISH_TIMEOUT, MCM_RXTXAPP_RUN_TIMEOUT
22+
DEFAULT_LOOP_COUNT,
23+
DEFAULT_REMOTE_IP_ADDR,
24+
DEFAULT_REMOTE_PORT,
25+
DEFAULT_PACING,
26+
DEFAULT_PAYLOAD_TYPE_ST2110_20,
27+
DEFAULT_PIXEL_FORMAT,
28+
MCM_ESTABLISH_TIMEOUT,
29+
MTL_ESTABLISH_TIMEOUT,
30+
MCM_RXTXAPP_RUN_TIMEOUT,
2431
)
2532
from Engine.mcm_apps import get_media_proxy_port, get_mtl_path
2633
from Engine.media_files import video_files_25_03 as yuv_files
@@ -62,14 +69,15 @@ def test_st2110_rttxapp_mcm_to_mtl_video(
6269

6370
frame_rate = str(yuv_files[video_type]["fps"])
6471
video_size = f'{yuv_files[video_type]["width"]}x{yuv_files[video_type]["height"]}'
65-
video_pixel_format = video_file_format_to_payload_format(str(yuv_files[video_type]["file_format"]))
72+
video_pixel_format = video_file_format_to_payload_format(
73+
str(yuv_files[video_type]["file_format"])
74+
)
6675

6776
rx_nicctl = Nicctl(
6877
mtl_path=rx_mtl_path,
6978
host=rx_mtl_host,
7079
)
7180
rx_vfs = rx_nicctl.prepare_vfs_for_test(rx_mtl_host.network_interfaces[0])
72-
7381
mtl_rx_inp = FFmpegMtlSt20pRx(
7482
video_size = video_size,
7583
pixel_format = video_pixel_format,

0 commit comments

Comments
 (0)