mirror of
https://github.com/facefusion/facefusion.git
synced 2026-09-15 20:15:28 +02:00
ensure unique job ids
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
import os
|
||||
|
||||
from facefusion.jobs.job_helper import get_step_output_path
|
||||
from facefusion.jobs.job_helper import get_step_output_path, suggest_job_id
|
||||
|
||||
|
||||
def test_get_step_output_path() -> None:
|
||||
assert get_step_output_path('test-job', 0, 'test.mp4') == 'test-test-job-0.mp4'
|
||||
assert get_step_output_path('test-job', 0, 'test/test.mp4') == os.path.join('test', 'test-test-job-0.mp4')
|
||||
assert get_step_output_path('test-job', 0, 'invalid') is None
|
||||
|
||||
|
||||
def test_suggest_job_id() -> None:
|
||||
job_id_1 = suggest_job_id()
|
||||
job_id_2 = suggest_job_id()
|
||||
|
||||
assert job_id_1.startswith('job')
|
||||
assert not job_id_1 == job_id_2
|
||||
|
||||
Reference in New Issue
Block a user