mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix invokeai-configure to use isolated argument-parsing pattern
This commit is contained in:
committed by
psychedelicious
parent
d871fca643
commit
5d16a40b95
@ -1,4 +1,3 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from tempfile import TemporaryDirectory
|
||||
from typing import Any
|
||||
@ -8,7 +7,6 @@ from omegaconf import OmegaConf
|
||||
from pydantic import ValidationError
|
||||
|
||||
from invokeai.app.services.config.config_default import InvokeAIAppConfig, get_config, load_and_migrate_config
|
||||
from invokeai.frontend.cli.arg_parser import InvokeAIArgs
|
||||
|
||||
v4_config = """
|
||||
schema_version: 4
|
||||
@ -78,13 +76,6 @@ def test_read_config_from_file(tmp_path: Path):
|
||||
assert config.port == 8080
|
||||
|
||||
|
||||
def test_arg_parsing():
|
||||
sys.argv = ["test_config.py", "--root", "/tmp"]
|
||||
InvokeAIArgs.parse_args()
|
||||
config = get_config()
|
||||
assert config.root_path == Path("/tmp")
|
||||
|
||||
|
||||
def test_migrate_v3_config_from_file(tmp_path: Path):
|
||||
"""Test reading configuration from a file."""
|
||||
temp_config_file = tmp_path / "temp_invokeai.yaml"
|
||||
|
Reference in New Issue
Block a user