2023-12-12 01:35:42 +00:00
|
|
|
from logging import Logger
|
|
|
|
from unittest import mock
|
|
|
|
|
|
|
|
from invokeai.app.services.config.config_default import InvokeAIAppConfig
|
|
|
|
from invokeai.app.services.image_files.image_files_base import ImageFileStorageBase
|
|
|
|
from invokeai.app.services.shared.sqlite.sqlite_database import SqliteDatabase
|
2023-12-13 00:19:59 +00:00
|
|
|
from invokeai.app.services.shared.sqlite.sqlite_util import init_db
|
2023-12-12 01:35:42 +00:00
|
|
|
|
|
|
|
|
2023-12-13 00:25:57 +00:00
|
|
|
def create_mock_sqlite_database(config: InvokeAIAppConfig, logger: Logger) -> SqliteDatabase:
|
2023-12-12 23:13:03 +00:00
|
|
|
image_files = mock.Mock(spec=ImageFileStorageBase)
|
2023-12-13 00:19:59 +00:00
|
|
|
db = init_db(config=config, logger=logger, image_files=image_files)
|
2023-12-12 23:13:03 +00:00
|
|
|
return db
|