mirror of
https://github.com/facefusion/facefusion.git
synced 2026-09-23 16:00:45 +02:00
Simplify testing
This commit is contained in:
+5
-13
@@ -11,13 +11,13 @@ def before_all() -> None:
|
|||||||
[
|
[
|
||||||
'https://github.com/facefusion/facefusion-assets/releases/download/examples/source.jpg',
|
'https://github.com/facefusion/facefusion-assets/releases/download/examples/source.jpg',
|
||||||
'https://github.com/facefusion/facefusion-assets/releases/download/examples/source.mp3',
|
'https://github.com/facefusion/facefusion-assets/releases/download/examples/source.mp3',
|
||||||
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-1080p.mp4'
|
'https://github.com/facefusion/facefusion-assets/releases/download/examples/target-240p.mp4'
|
||||||
])
|
])
|
||||||
subprocess.run([ 'ffmpeg', '-i', '.assets/examples/target-1080p.mp4', '-vframes', '1', '.assets/examples/target-1080p.jpg' ])
|
subprocess.run([ 'ffmpeg', '-i', '.assets/examples/target-240p.mp4', '-vframes', '1', '.assets/examples/target-240p.jpg' ])
|
||||||
|
|
||||||
|
|
||||||
def test_image_to_image() -> None:
|
def test_image_to_image() -> None:
|
||||||
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.jpg', '-o', '.assets/examples', '--headless' ]
|
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-240p.jpg', '-o', '.assets/examples', '--headless' ]
|
||||||
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
|
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
|
||||||
|
|
||||||
assert run.returncode == 0
|
assert run.returncode == 0
|
||||||
@@ -25,7 +25,7 @@ def test_image_to_image() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_image_to_video() -> None:
|
def test_image_to_video() -> None:
|
||||||
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.mp4', '-o', '.assets/examples', '--trim-frame-end', '10', '--headless' ]
|
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-240p.mp4', '-o', '.assets/examples', '--trim-frame-end', '10', '--headless' ]
|
||||||
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
|
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
|
||||||
|
|
||||||
assert run.returncode == 0
|
assert run.returncode == 0
|
||||||
@@ -33,15 +33,7 @@ def test_image_to_video() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_audio_to_video() -> None:
|
def test_audio_to_video() -> None:
|
||||||
commands = [ sys.executable, 'run.py', '--frame-processors', 'lip_sync', '-s', '.assets/examples/source.mp3', '-t', '.assets/examples/target-1080p.mp4', '-o', '.assets/examples', '--trim-frame-end', '10', '--headless' ]
|
commands = [ sys.executable, 'run.py', '--frame-processors', 'lip_sync', '-s', '.assets/examples/source.mp3', '-t', '.assets/examples/target-240p.mp4', '-o', '.assets/examples', '--trim-frame-end', '10', '--headless' ]
|
||||||
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
|
|
||||||
|
|
||||||
assert run.returncode == 0
|
|
||||||
assert 'video succeed' in run.stdout.decode()
|
|
||||||
|
|
||||||
|
|
||||||
def test_image_and_audio_to_video() -> None:
|
|
||||||
commands = [ sys.executable, 'run.py', '--frame-processors', 'lip_sync', 'face_swapper', '-s', '.assets/examples/source.mp3', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.mp4', '-o', '.assets/examples', '--trim-frame-end', '10', '--headless' ]
|
|
||||||
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
|
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
|
||||||
|
|
||||||
assert run.returncode == 0
|
assert run.returncode == 0
|
||||||
|
|||||||
@@ -19,5 +19,5 @@ def test_get_download_size() -> None:
|
|||||||
|
|
||||||
def test_is_download_done() -> None:
|
def test_is_download_done() -> None:
|
||||||
assert is_download_done('https://github.com/facefusion/facefusion-assets/releases/download/examples/target-240p.mp4', '.assets/examples/target-240p.mp4') is True
|
assert is_download_done('https://github.com/facefusion/facefusion-assets/releases/download/examples/target-240p.mp4', '.assets/examples/target-240p.mp4') is True
|
||||||
assert is_download_done('https://github.com/facefusion/facefusion-assets/releases/download/examples/target-240p.mp4','invalid') is False
|
assert is_download_done('https://github.com/facefusion/facefusion-assets/releases/download/examples/target-240p.mp4', 'invalid') is False
|
||||||
assert is_download_done('invalid', 'invalid') is False
|
assert is_download_done('invalid', 'invalid') is False
|
||||||
|
|||||||
Reference in New Issue
Block a user