mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-11 19:56:03 +00:00
remove MagicMock for argparse.Namespace
no need to mock Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
parent
4336bf96a5
commit
9b8240e740
1 changed files with 9 additions and 8 deletions
|
|
@ -277,7 +277,7 @@ def test_providers_flag_generates_config_with_api_keys():
|
||||||
API keys and other credentials for remote providers like remote::openai.
|
API keys and other credentials for remote providers like remote::openai.
|
||||||
"""
|
"""
|
||||||
import argparse
|
import argparse
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from llama_stack.cli.stack.run import StackRun
|
from llama_stack.cli.stack.run import StackRun
|
||||||
|
|
||||||
|
|
@ -286,13 +286,14 @@ def test_providers_flag_generates_config_with_api_keys():
|
||||||
stack_run = StackRun(subparsers)
|
stack_run = StackRun(subparsers)
|
||||||
|
|
||||||
# Create args with --providers flag set
|
# Create args with --providers flag set
|
||||||
args = MagicMock()
|
args = argparse.Namespace(
|
||||||
args.providers = "inference=remote::openai"
|
providers="inference=remote::openai",
|
||||||
args.config = None
|
config=None,
|
||||||
args.port = 8321
|
port=8321,
|
||||||
args.image_type = None
|
image_type=None,
|
||||||
args.image_name = None
|
image_name=None,
|
||||||
args.enable_ui = False
|
enable_ui=False,
|
||||||
|
)
|
||||||
|
|
||||||
# Mock _uvicorn_run to prevent starting a server
|
# Mock _uvicorn_run to prevent starting a server
|
||||||
with patch.object(stack_run, "_uvicorn_run"):
|
with patch.object(stack_run, "_uvicorn_run"):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue