mirror of
https://github.com/facefusion/facefusion.git
synced 2026-05-12 10:31:33 +02:00
fix test
This commit is contained in:
@@ -28,23 +28,6 @@ def get_capabilities() -> Dict[str, Any]:
|
||||
return ARGS_STORE.get('api')
|
||||
|
||||
|
||||
def register_args(keys : List[str], scopes : List[Scope]) -> None:
|
||||
for key in keys:
|
||||
entry =\
|
||||
{
|
||||
'default': None,
|
||||
'choices': None
|
||||
}
|
||||
|
||||
for scope in scopes:
|
||||
if scope == 'api':
|
||||
ARGS_STORE['api'][key] = entry
|
||||
if scope == 'cli':
|
||||
ARGS_STORE['cli'][key] = entry
|
||||
if scope == 'sys':
|
||||
ARGS_STORE['sys'][key] = entry
|
||||
|
||||
|
||||
def register_argument(action : Action, scopes : List[Scope]) -> None:
|
||||
key = action.dest
|
||||
choices : Any = list(action.choices) if action.choices else None
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import subprocess
|
||||
from argparse import ArgumentParser
|
||||
from typing import Iterator
|
||||
|
||||
import pytest
|
||||
@@ -23,7 +24,13 @@ def before_all() -> None:
|
||||
|
||||
@pytest.fixture(scope = 'module')
|
||||
def test_client() -> Iterator[TestClient]:
|
||||
args_store.register_args([ 'source_paths', 'target_path', 'execution_providers' ], scopes = [ 'api' ])
|
||||
program = ArgumentParser()
|
||||
source_paths_action = program.add_argument('--source-paths', nargs = '+', default = None)
|
||||
target_path_action = program.add_argument('--target-path', default = None)
|
||||
execution_providers_action = program.add_argument('--execution-providers', nargs = '+', default = None)
|
||||
args_store.register_argument(source_paths_action, scopes = [ 'api' ])
|
||||
args_store.register_argument(target_path_action, scopes = [ 'api' ])
|
||||
args_store.register_argument(execution_providers_action, scopes = [ 'api' ])
|
||||
state_manager.init_item('execution_providers', [ 'cpu' ])
|
||||
|
||||
with TestClient(create_api()) as test_client:
|
||||
|
||||
Reference in New Issue
Block a user