feat: major architectural refactor
- Refactor memory system (episodic/STM/LTM with components) - Implement complete subtitle domain (scanner, matcher, placer) - Add YAML workflow infrastructure - Externalize knowledge base (patterns, release groups) - Add comprehensive testing suite - Create manual testing CLIs
This commit is contained in:
@@ -13,7 +13,7 @@ from alfred.infrastructure.persistence import (
|
||||
has_memory,
|
||||
init_memory,
|
||||
)
|
||||
from alfred.infrastructure.persistence.context import _memory_ctx
|
||||
from alfred.infrastructure.persistence.context import reset_memory
|
||||
|
||||
|
||||
def is_iso_format(s: str) -> bool:
|
||||
@@ -33,10 +33,8 @@ class TestLongTermMemory:
|
||||
|
||||
def test_default_values(self):
|
||||
ltm = LongTermMemory()
|
||||
assert ltm.config == {}
|
||||
assert ltm.preferences["preferred_quality"] == "1080p"
|
||||
assert "en" in ltm.preferences["preferred_languages"]
|
||||
assert ltm.library == {"movies": [], "tv_shows": []}
|
||||
assert ltm.media_preferences.quality == "1080p"
|
||||
assert "en" in ltm.media_preferences.audio_languages
|
||||
assert ltm.following == []
|
||||
|
||||
def test_set_and_get_config(self):
|
||||
@@ -124,7 +122,7 @@ class TestLongTermMemory:
|
||||
}
|
||||
ltm = LongTermMemory.from_dict(data)
|
||||
assert ltm.get_config("download_folder") == "/downloads"
|
||||
assert ltm.preferences["preferred_quality"] == "4K"
|
||||
assert ltm.media_preferences.quality == "4K"
|
||||
assert len(ltm.library["movies"]) == 1
|
||||
|
||||
|
||||
@@ -230,12 +228,12 @@ class TestMemoryContext:
|
||||
"""Tests for memory context functions."""
|
||||
|
||||
def test_get_memory_not_initialized(self):
|
||||
_memory_ctx.set(None)
|
||||
reset_memory()
|
||||
with pytest.raises(RuntimeError, match="Memory not initialized"):
|
||||
get_memory()
|
||||
|
||||
def test_init_memory(self, temp_dir):
|
||||
_memory_ctx.set(None)
|
||||
reset_memory()
|
||||
memory = init_memory(str(temp_dir))
|
||||
assert has_memory()
|
||||
assert get_memory() is memory
|
||||
|
||||
Reference in New Issue
Block a user