Skip to content

Commit 92c07b1

Browse files
committed
Fix formatting
1 parent b975b69 commit 92c07b1

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

tests/validation/mtl_engine/GstreamerApp.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# SPDX-License-Identifier: BSD-3-Clause
22
# Copyright(c) 2024-2025 Intel Corporation
33

4-
import hashlib
54
import logging
65
import os
7-
import time
86
import re
7+
import time
98

109
from mtl_engine.RxTxApp import prepare_tcpdump
1110

@@ -54,20 +53,20 @@ def fract_format(framerate: str) -> str:
5453
# If already in fractional format, return as-is
5554
if "/" in framerate:
5655
return framerate
57-
56+
5857
# Convert specific decimal framerates to fractional format
5958
framerate_map = {
6059
"23.98": "2398/100",
61-
"23.976": "2398/100",
60+
"23.976": "2398/100",
6261
"29.97": "2997/100",
6362
"59.94": "5994/100",
6463
"119.88": "11988/100"
6564
}
66-
65+
6766
# Check if it's one of the special decimal framerates
6867
if framerate in framerate_map:
6968
return framerate_map[framerate]
70-
69+
7170
# For integer framerates, add /1
7271
try:
7372
int(framerate) # Validate it's a number
@@ -324,6 +323,7 @@ def setup_gstreamer_st40p_rx_pipeline(
324323

325324
return pipeline_command
326325

326+
327327
def execute_test(
328328
build: str,
329329
tx_command: dict,
@@ -357,15 +357,15 @@ def execute_test(
357357
:return: True if test passed, False otherwise
358358
"""
359359
is_dual = tx_host is not None and rx_host is not None
360-
360+
361361
if is_dual:
362362
logger.info("Executing dual host GStreamer test")
363363
tx_remote_host = tx_host
364364
rx_remote_host = rx_host
365365
else:
366366
logger.info("Executing single host GStreamer test")
367367
tx_remote_host = rx_remote_host = host
368-
368+
369369
case_id = os.environ.get("PYTEST_CURRENT_TEST", "gstreamer_test")
370370
case_id = case_id[: case_id.rfind("(") - 1] if "(" in case_id else case_id
371371

@@ -374,10 +374,10 @@ def execute_test(
374374

375375
tx_process = None
376376
rx_process = None
377-
377+
378378
if is_dual:
379379
tx_tcpdump = prepare_tcpdump(capture_cfg, tx_host) if capture_cfg else None
380-
rx_tcpdump = prepare_tcpdump(capture_cfg, rx_host) if capture_cfg else None
380+
# rx_tcpdump = prepare_tcpdump(capture_cfg, rx_host) if capture_cfg else None # Unused
381381
tcpdump = tx_tcpdump
382382
else:
383383
tcpdump = prepare_tcpdump(capture_cfg, host)
@@ -496,11 +496,12 @@ def execute_test(
496496
else:
497497
# For single host tests, both files are on the same host
498498
file_compare = compare_files(input_file, output_file, tx_remote_host, rx_remote_host)
499-
499+
500500
logger.info(f"File comparison: {file_compare}")
501501

502502
return file_compare
503503

504+
504505
def compare_files(input_file, output_file, input_host=None, output_host=None):
505506
"""
506507
Compare files on remote hosts.
@@ -519,7 +520,7 @@ def compare_files(input_file, output_file, input_host=None, output_host=None):
519520
logger.info(f"Input file size: {input_file_size}")
520521
else:
521522
logger.info(f"Input file {input_file} does not exist - skipping input validation")
522-
523+
523524
# Check output file size (always remote)
524525
output_stat_proc = run(f"stat -c '%s' {output_file}", host=output_host)
525526
if output_stat_proc.return_code != 0:
@@ -536,7 +537,7 @@ def compare_files(input_file, output_file, input_host=None, output_host=None):
536537
else:
537538
log_fail("Output file is empty")
538539
return False
539-
540+
540541
# If input file exists, do full comparison
541542
if input_file_size != output_file_size:
542543
log_fail("File size is different")
@@ -556,10 +557,10 @@ def compare_files(input_file, output_file, input_host=None, output_host=None):
556557

557558
logger.info(f"Input file hash: {i_hash}")
558559
logger.info(f"Output file hash: {o_hash}")
559-
560+
560561
if i_hash and o_hash and i_hash == o_hash:
561562
return True
562-
563+
563564
except Exception as e:
564565
log_fail(f"Error during file comparison: {e}")
565566
return False
@@ -604,5 +605,4 @@ def get_case_id() -> str:
604605

605606
def sanitize_filename(name: str) -> str:
606607
"""Replace unsafe characters with underscores"""
607-
import re
608608
return re.sub(r"[^A-Za-z0-9_.-]", "_", name)

0 commit comments

Comments
 (0)