fix(tests): move memory model tests to avoid import conflicts
Moved tests/unit/models/memory/ to tests/models/memory/ to avoid Python import path conflicts when pytest collects all tests. The conflict was caused by tests/models/ and tests/unit/models/ both having __init__.py files, causing Python to confuse app.models.memory imports. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
71
backend/tests/models/memory/test_enums.py
Normal file
71
backend/tests/models/memory/test_enums.py
Normal file
@@ -0,0 +1,71 @@
|
||||
# tests/unit/models/memory/test_enums.py
|
||||
"""Unit tests for memory model enums."""
|
||||
|
||||
from app.models.memory.enums import (
|
||||
ConsolidationStatus,
|
||||
ConsolidationType,
|
||||
EpisodeOutcome,
|
||||
ScopeType,
|
||||
)
|
||||
|
||||
|
||||
class TestScopeType:
|
||||
"""Tests for ScopeType enum."""
|
||||
|
||||
def test_all_values_exist(self) -> None:
|
||||
"""Test all expected scope types exist."""
|
||||
assert ScopeType.GLOBAL.value == "global"
|
||||
assert ScopeType.PROJECT.value == "project"
|
||||
assert ScopeType.AGENT_TYPE.value == "agent_type"
|
||||
assert ScopeType.AGENT_INSTANCE.value == "agent_instance"
|
||||
assert ScopeType.SESSION.value == "session"
|
||||
|
||||
def test_scope_count(self) -> None:
|
||||
"""Test we have exactly 5 scope types."""
|
||||
assert len(ScopeType) == 5
|
||||
|
||||
|
||||
class TestEpisodeOutcome:
|
||||
"""Tests for EpisodeOutcome enum."""
|
||||
|
||||
def test_all_values_exist(self) -> None:
|
||||
"""Test all expected outcome values exist."""
|
||||
assert EpisodeOutcome.SUCCESS.value == "success"
|
||||
assert EpisodeOutcome.FAILURE.value == "failure"
|
||||
assert EpisodeOutcome.PARTIAL.value == "partial"
|
||||
|
||||
def test_outcome_count(self) -> None:
|
||||
"""Test we have exactly 3 outcome types."""
|
||||
assert len(EpisodeOutcome) == 3
|
||||
|
||||
|
||||
class TestConsolidationType:
|
||||
"""Tests for ConsolidationType enum."""
|
||||
|
||||
def test_all_values_exist(self) -> None:
|
||||
"""Test all expected consolidation types exist."""
|
||||
assert ConsolidationType.WORKING_TO_EPISODIC.value == "working_to_episodic"
|
||||
assert ConsolidationType.EPISODIC_TO_SEMANTIC.value == "episodic_to_semantic"
|
||||
assert (
|
||||
ConsolidationType.EPISODIC_TO_PROCEDURAL.value == "episodic_to_procedural"
|
||||
)
|
||||
assert ConsolidationType.PRUNING.value == "pruning"
|
||||
|
||||
def test_consolidation_count(self) -> None:
|
||||
"""Test we have exactly 4 consolidation types."""
|
||||
assert len(ConsolidationType) == 4
|
||||
|
||||
|
||||
class TestConsolidationStatus:
|
||||
"""Tests for ConsolidationStatus enum."""
|
||||
|
||||
def test_all_values_exist(self) -> None:
|
||||
"""Test all expected status values exist."""
|
||||
assert ConsolidationStatus.PENDING.value == "pending"
|
||||
assert ConsolidationStatus.RUNNING.value == "running"
|
||||
assert ConsolidationStatus.COMPLETED.value == "completed"
|
||||
assert ConsolidationStatus.FAILED.value == "failed"
|
||||
|
||||
def test_status_count(self) -> None:
|
||||
"""Test we have exactly 4 status types."""
|
||||
assert len(ConsolidationStatus) == 4
|
||||
Reference in New Issue
Block a user