ensure unique job ids

This commit is contained in:
henryruhs
2026-09-10 21:21:53 +02:00
parent 574965f65d
commit d054cedf85
2 changed files with 11 additions and 2 deletions
+9 -1
View File
@@ -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