From fbbf9c01b5104d560287a0e8e2e752f4b3eaaa6b Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 12 Mar 2024 00:30:09 +1100 Subject: [PATCH] tests: fix remaining tests --- .../model_records/test_model_records_sql.py | 3 ++- .../backend/model_manager/model_manager_fixtures.py | 13 +++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/app/services/model_records/test_model_records_sql.py b/tests/app/services/model_records/test_model_records_sql.py index 94b61bf1bf..7009a81025 100644 --- a/tests/app/services/model_records/test_model_records_sql.py +++ b/tests/app/services/model_records/test_model_records_sql.py @@ -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) diff --git a/tests/backend/model_manager/model_manager_fixtures.py b/tests/backend/model_manager/model_manager_fixtures.py index af66264f9c..a1109c8021 100644 --- a/tests/backend/model_manager/model_manager_fixtures.py +++ b/tests/backend/model_manager/model_manager_fixtures.py @@ -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,