fix: make AssetManager registry path relative to storage_path by default
This is a robust fix for test registry isolation that addresses the root cause: when AssetManager is created with only storage_path, the registry now defaults to storage_path.parent/asset_registry.json instead of cwd/asset_registry.json. Benefits: - Tests using temp directories automatically get isolated registries - No need to manually fix every test file - Consistent behavior: registry stays with the asset storage - Explicit registry_path still works for custom configurations This makes the AssetManager behavior more intuitive and prevents test artifacts from contaminating the production asset registry. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9d3c6f3c81
commit
4ceb6cce42
1 changed files with 3 additions and 1 deletions
|
|
@ -64,8 +64,10 @@ class AssetManager:
|
|||
assets_config.get('storage_path', DEFAULT_ASSETS_DIR)
|
||||
).resolve()
|
||||
|
||||
# Default registry path should be relative to storage_path, not cwd
|
||||
default_registry_path = self.storage_path.parent / DEFAULT_REGISTRY_FILENAME
|
||||
self.registry_path = Path(
|
||||
assets_config.get('registry_path', DEFAULT_REGISTRY_FILENAME)
|
||||
assets_config.get('registry_path', default_registry_path)
|
||||
).resolve()
|
||||
|
||||
self.database_path = Path(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue