mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-21 23:44:04 +00:00
fix: ruff linting errors and add comprehensive test coverage for asset queries
- Fix unused imports in routes.py, asset.py, manager.py, asset_management.py, ingest.py - Fix whitespace issues in upload.py, asset_info.py, ingest.py - Fix typo in manager.py (stray character after result["asset"]) - Fix broken import in test_metadata.py (project_kv moved to asset_info.py) - Add fixture override in queries/conftest.py for unit test isolation Add 48 new tests covering all previously untested query functions: - asset.py: upsert_asset, bulk_insert_assets - cache_state.py: upsert_cache_state, delete_cache_states_outside_prefixes, get_orphaned_seed_asset_ids, delete_assets_by_ids, get_cache_states_for_prefixes, bulk_set_needs_verify, delete_cache_states_by_ids, delete_orphaned_seed_asset, bulk_insert_cache_states_ignore_conflicts, get_cache_states_by_paths_and_asset_ids - asset_info.py: insert_asset_info, get_or_create_asset_info, update_asset_info_timestamps, replace_asset_info_metadata_projection, bulk_insert_asset_infos_ignore_conflicts, get_asset_info_ids_by_ids - tags.py: bulk_insert_tags_and_meta Total: 119 tests pass (up from 71) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
from typing import Iterable
|
||||
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import select
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Pure atomic database queries for AssetInfo operations.
|
||||
|
||||
This module contains only atomic DB operations - no business logic,
|
||||
This module contains only atomic DB operations - no business logic,
|
||||
no filesystem operations, no orchestration across multiple tables.
|
||||
"""
|
||||
from collections import defaultdict
|
||||
@@ -246,7 +246,7 @@ def get_or_create_asset_info(
|
||||
)
|
||||
if info:
|
||||
return info, True
|
||||
|
||||
|
||||
existing = session.execute(
|
||||
select(AssetInfo)
|
||||
.where(
|
||||
|
||||
Reference in New Issue
Block a user