mirror of
https://github.com/facefusion/facefusion.git
synced 2026-09-15 20:15:28 +02:00
32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
from time import sleep
|
|
|
|
import pytest
|
|
|
|
from facefusion import state_manager
|
|
from facefusion.jobs.job_list import compose_job_list
|
|
from facefusion.jobs.job_manager import clear_jobs, create_job, init_jobs
|
|
from .assert_helper import get_test_jobs_directory
|
|
|
|
|
|
@pytest.fixture(scope = 'module', autouse = True)
|
|
def before_all() -> None:
|
|
state_manager.init()
|
|
state_manager.init_item('jobs_path', get_test_jobs_directory())
|
|
|
|
|
|
@pytest.fixture(scope = 'function', autouse = True)
|
|
def before_each() -> None:
|
|
clear_jobs(get_test_jobs_directory())
|
|
init_jobs(state_manager.get_jobs_path())
|
|
|
|
|
|
def test_compose_job_list() -> None:
|
|
create_job('job-test-compose-job-list-1')
|
|
sleep(0.5)
|
|
create_job('job-test-compose-job-list-2')
|
|
job_headers, job_contents = compose_job_list('drafted')
|
|
|
|
assert job_headers == [ 'job id', 'steps', 'date created', 'date updated', 'job status' ]
|
|
assert job_contents[0] == [ 'job-test-compose-job-list-1', 0, 'just now', None, 'drafted' ]
|
|
assert job_contents[1] == [ 'job-test-compose-job-list-2', 0, 'just now', None, 'drafted' ]
|