From 3a254f428c78eede3d8688fcc7c3cd37917b4270 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Sat, 21 Dec 2024 17:30:05 +0100 Subject: [PATCH] Fix CI --- facefusion/download.py | 5 ++--- facefusion/ffmpeg.py | 5 ++--- tests/test_download.py | 10 +++++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/facefusion/download.py b/facefusion/download.py index b68abca2..0812c732 100644 --- a/facefusion/download.py +++ b/facefusion/download.py @@ -49,10 +49,9 @@ def get_static_download_size(url : str) -> int: while line := process.stdout.readline().decode().lower(): if 'content-length:' in line: _, content_length = line.split('content-length:') - content_length = int(content_length) - if content_length > 0: - return content_length + if int(content_length) > 0: + return int(content_length) return 0 diff --git a/facefusion/ffmpeg.py b/facefusion/ffmpeg.py index c0ad21dc..a723f620 100644 --- a/facefusion/ffmpeg.py +++ b/facefusion/ffmpeg.py @@ -26,10 +26,9 @@ def run_ffmpeg_with_progress(args: List[str], update_progress : UpdateProgress) while line := process.stdout.readline().decode().lower(): if 'frame=' in line: _, frame_number = line.split('frame=') - frame_number = int(frame_number) - if frame_number > 0: - update_progress(frame_number) + if int(frame_number) > 0: + update_progress(int(frame_number)) if log_level == 'debug': log_debug(process) diff --git a/tests/test_download.py b/tests/test_download.py index 94215d0b..8cab9a7e 100644 --- a/tests/test_download.py +++ b/tests/test_download.py @@ -1,6 +1,6 @@ import pytest -from facefusion.download import conditional_download, get_static_download_size, ping_url +from facefusion.download import conditional_download, get_static_download_size, ping_static_url from .helper import get_test_examples_directory @@ -12,12 +12,12 @@ def before_all() -> None: ]) -def test_get_download_size() -> None: +def test_get_static_download_size() -> None: assert get_static_download_size('https://github.com/facefusion/facefusion-assets/releases/download/examples-3.0.0/target-240p.mp4') == 191675 assert get_static_download_size('https://github.com/facefusion/facefusion-assets/releases/download/examples-3.0.0/target-360p.mp4') == 370732 assert get_static_download_size('invalid') == 0 -def test_ping_url() -> None: - assert ping_url('https://github.com') is True - assert ping_url('invalid') is False +def test_static_ping_url() -> None: + assert ping_static_url('https://github.com') is True + assert ping_static_url('invalid') is False