mirror of
https://github.com/facefusion/facefusion.git
synced 2026-08-12 12:00:21 +02:00
Patch 3.6.1 (#1078)
* Avast intercepts ssl cert and breaks curl * modernize dependencies * fix sanitizer for int range * comment out tests * disable testing for CI * disable testing for CI
This commit is contained in:
@@ -7,7 +7,7 @@ from facefusion.curl_builder import chain, ping, run, set_timeout
|
||||
def test_run() -> None:
|
||||
user_agent = metadata.get('name') + '/' + metadata.get('version')
|
||||
|
||||
assert run([]) == [ which('curl'), '--user-agent', user_agent, '--location', '--silent' ]
|
||||
assert run([]) == [ which('curl'), '--user-agent', user_agent, '--location', '--silent', '--ssl-no-revoke' ]
|
||||
|
||||
|
||||
def test_chain() -> None:
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
import pytest
|
||||
|
||||
from facefusion.common_helper import is_linux
|
||||
from facefusion.download import conditional_download
|
||||
from facefusion.vision import calculate_histogram_difference, count_trim_frame_total, count_video_frame_total, detect_image_resolution, detect_video_duration, detect_video_fps, detect_video_resolution, match_frame_color, normalize_resolution, pack_resolution, predict_video_frame_total, read_image, read_video_frame, restrict_image_resolution, restrict_trim_frame, restrict_video_fps, restrict_video_resolution, scale_resolution, unpack_resolution, write_image
|
||||
from .helper import get_test_example_file, get_test_examples_directory, get_test_output_file, prepare_test_output_directory
|
||||
@@ -92,11 +94,13 @@ def test_restrict_video_fps() -> None:
|
||||
assert restrict_video_fps(get_test_example_file('target-1080p.mp4'), 60.0) == 25.0
|
||||
|
||||
|
||||
@pytest.mark.skipif(os.environ.get('CI') and is_linux(), reason = 'h264 codec not present')
|
||||
def test_detect_video_duration() -> None:
|
||||
assert detect_video_duration(get_test_example_file('target-240p.mp4')) == 10.8
|
||||
assert detect_video_duration('invalid') == 0
|
||||
|
||||
|
||||
@pytest.mark.skipif(os.environ.get('CI') and is_linux(), reason = 'h264 codec not present')
|
||||
def test_count_trim_frame_total() -> None:
|
||||
assert count_trim_frame_total(get_test_example_file('target-240p.mp4'), 0, 200) == 200
|
||||
assert count_trim_frame_total(get_test_example_file('target-240p.mp4'), 70, 270) == 200
|
||||
@@ -107,6 +111,7 @@ def test_count_trim_frame_total() -> None:
|
||||
assert count_trim_frame_total(get_test_example_file('target-240p.mp4'), None, None) == 270
|
||||
|
||||
|
||||
@pytest.mark.skipif(os.environ.get('CI') and is_linux(), reason = 'h264 codec not present')
|
||||
def test_restrict_trim_frame() -> None:
|
||||
assert restrict_trim_frame(get_test_example_file('target-240p.mp4'), 0, 200) == (0, 200)
|
||||
assert restrict_trim_frame(get_test_example_file('target-240p.mp4'), 70, 270) == (70, 270)
|
||||
@@ -117,6 +122,7 @@ def test_restrict_trim_frame() -> None:
|
||||
assert restrict_trim_frame(get_test_example_file('target-240p.mp4'), None, None) == (0, 270)
|
||||
|
||||
|
||||
@pytest.mark.skipif(os.environ.get('CI') and is_linux(), reason = 'h264 codec not present')
|
||||
def test_detect_video_resolution() -> None:
|
||||
assert detect_video_resolution(get_test_example_file('target-240p.mp4')) == (426, 226)
|
||||
assert detect_video_resolution(get_test_example_file('target-240p-90deg.mp4')) == (226, 426)
|
||||
|
||||
Reference in New Issue
Block a user