InvokeAI/tests
psychedelicious 88c08bbfc7 fix(item-storage-memory): throw when requested item does not exist
- `ItemStorageMemory.get` now throws an `ItemNotFoundError` when the requested `item_id` is not found.
- Update docstrings in ABC and tests.

The new memory item storage implementation implemented the `get` method incorrectly, by returning `None` if the item didn't exist.

The ABC typed `get` as returning `T`, while the SQLite implementation typed `get` as returning `Optional[T]`. The SQLite implementation was referenced when writing the memory implementation.

This mismatched typing is a violation of the Liskov substitution principle, because the signature of the implementation of `get` in the implementation is wider than the abstract class's definition. Using `pyright` in strict mode catches this.

In `invocation_stats_default`, this introduced an error. The `_prune_stats` method calls `get`, expecting the method to throw if the item is not found. If the graph is no longer stored in the bounded item storage, we will call `is_complete()` on `None`, causing the error.

Note: This error condition never arose the SQLite implementation because it parsed the item with pydantic before returning it, which would throw if the item was not found. It implicitly threw, while the memory implementation did not.
2024-02-03 07:34:06 -05:00
..
aa_nodes chore(item_storage): excise SqliteItemStorage 2024-02-02 09:20:41 +11:00
app Model Manager Refactor: Install remote models and store their tags and other metadata (#5361) 2024-01-14 19:54:53 +00:00
backend Model Manager Refactor: Install remote models and store their tags and other metadata (#5361) 2024-01-14 19:54:53 +00:00
fixtures fix(db): formatting 2023-12-13 11:25:57 +11:00
inpainting Rename default schedulers across the app 2023-05-12 03:44:20 +12:00
test_model_manager prevent vae: '' from crashing model 2023-08-10 17:33:04 -04:00
test_model_probe/vae test(model management): test VaeFolderProbe 2023-09-20 12:48:59 -07:00
__init__.py parent 9eed1919c2 2023-02-24 18:57:02 -08:00
conftest.py Model Manager Refactor: Install remote models and store their tags and other metadata (#5361) 2024-01-14 19:54:53 +00:00
dev_prompts.txt Added linux to the workflows (#463) 2022-09-16 17:46:57 -04:00
legacy_tests.sh Add back old dream.py as legacy_api.py 2022-10-12 20:35:56 -04:00
test_config.py feat: workflow library (#5148) 2023-12-09 09:48:38 +11:00
test_item_storage_memory.py fix(item-storage-memory): throw when requested item does not exist 2024-02-03 07:34:06 -05:00
test_model_manager.py feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
test_model_probe.py lint 2023-09-20 12:53:25 -07:00
test_path.py fix(tests): remove test for frontend build 2023-12-11 12:30:13 +11:00
test_profiler.py feat: add profiler util (#5601) 2024-01-31 10:51:57 +00:00
test_sqlite_migrator.py fix(db): rename "SQLiteMigrator" -> "SqliteMigrator" 2023-12-13 11:31:15 +11:00
validate_pr_prompt.txt fixes to env parsing, textual inversion & help text 2023-05-18 10:48:23 -04:00