tests: fix remaining tests

This commit is contained in:
psychedelicious 2024-03-12 00:30:09 +11:00
parent 15cef98a8b
commit fbbf9c01b5
2 changed files with 7 additions and 9 deletions

View File

@ -34,7 +34,8 @@ from tests.fixtures.sqlite_database import create_mock_sqlite_database
def store(
datadir: Any,
) -> ModelRecordServiceSQL:
config = InvokeAIAppConfig(root=datadir)
config = InvokeAIAppConfig()
config.set_root(datadir)
logger = InvokeAILogger.get_logger(config=config)
db = create_mock_sqlite_database(config, logger)
return ModelRecordServiceSQL(db)

View File

@ -92,11 +92,8 @@ def diffusers_dir(mm2_model_files: Path) -> Path:
@pytest.fixture
def mm2_app_config(mm2_root_dir: Path) -> InvokeAIAppConfig:
app_config = InvokeAIAppConfig(
root=mm2_root_dir,
models_dir=mm2_root_dir / "models",
log_level="info",
)
app_config = InvokeAIAppConfig(models_dir=mm2_root_dir / "models", log_level="info")
app_config.set_root(mm2_root_dir)
return app_config
@ -116,10 +113,10 @@ def mm2_download_queue(mm2_session: Session, request: FixtureRequest) -> Downloa
def mm2_loader(mm2_app_config: InvokeAIAppConfig, mm2_record_store: ModelRecordServiceBase) -> ModelLoadServiceBase:
ram_cache = ModelCache(
logger=InvokeAILogger.get_logger(),
max_cache_size=mm2_app_config.ram_cache_size,
max_vram_cache_size=mm2_app_config.vram_cache_size,
max_cache_size=mm2_app_config.ram,
max_vram_cache_size=mm2_app_config.vram,
)
convert_cache = ModelConvertCache(mm2_app_config.models_convert_cache_path)
convert_cache = ModelConvertCache(mm2_app_config.convert_cache_path)
return ModelLoadService(
app_config=mm2_app_config,
ram_cache=ram_cache,