From e16f5bca113e49a431b5353fe8e3ada88919536f Mon Sep 17 00:00:00 2001 From: harisreedhar Date: Mon, 16 Feb 2026 21:07:05 +0530 Subject: [PATCH] fix test --- facefusion/args_store.py | 17 ----------------- tests/test_api_state.py | 9 ++++++++- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/facefusion/args_store.py b/facefusion/args_store.py index c4355068..ddc1ccc7 100644 --- a/facefusion/args_store.py +++ b/facefusion/args_store.py @@ -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 diff --git a/tests/test_api_state.py b/tests/test_api_state.py index ff6cd4a1..6fd00dd8 100644 --- a/tests/test_api_state.py +++ b/tests/test_api_state.py @@ -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: