Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
dawoodkhan82 committed Aug 23, 2023
1 parent c9091f1 commit b44df96
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions test/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,26 +451,30 @@ def test_make_waveform_with_spaces_in_filename():
shutil.copy("test/test_files/audio_sample.wav", audio)
waveform = gr.make_waveform(audio)
assert waveform.endswith(".mp4")

try:
command = [
'ffprobe',
'-v', 'error',
'-select_streams', 'v:0',
'-show_entries', 'stream=width,height',
'-of', 'json',
waveform
"ffprobe",
"-v",
"error",
"-select_streams",
"v:0",
"-show_entries",
"stream=width,height",
"-of",
"json",
waveform,
]

result = subprocess.run(command, capture_output=True, text=True, check=True)
output = result.stdout
data = json.loads(output)
width = data['streams'][0]['width']
height = data['streams'][0]['height']

width = data["streams"][0]["width"]
height = data["streams"][0]["height"]
assert width == 1000
assert height == 400

except subprocess.CalledProcessError as e:
print("Error retrieving resolution of output waveform video:", e)

Expand Down

0 comments on commit b44df96

Please sign in to comment.