Buckets:

download
raw
1.55 kB
"""Unit tests for Phase 3: Authoritative flag and lineage-aware queries."""
from contextfs.schemas import Memory, MemoryType
class TestAuthoritativeField:
"""Test authoritative field on Memory model."""
def test_memory_default_not_authoritative(self):
"""Test that memories are not authoritative by default."""
memory = Memory(content="Test memory", type=MemoryType.FACT)
assert memory.authoritative is False
def test_memory_can_be_authoritative(self):
"""Test creating an authoritative memory."""
memory = Memory(
content="Authoritative memory",
type=MemoryType.DECISION,
authoritative=True,
)
assert memory.authoritative is True
def test_authoritative_with_structured_data(self):
"""Test authoritative memory with structured data."""
memory = Memory(
content="Database decision",
type=MemoryType.DECISION,
structured_data={"decision": "Use PostgreSQL"},
authoritative=True,
)
assert memory.authoritative is True
assert memory.structured_data["decision"] == "Use PostgreSQL"
def test_factory_methods_accept_authoritative(self):
"""Test that factory methods accept authoritative kwarg."""
memory = Memory.decision(
content="Important decision",
decision="Use Redis",
authoritative=True,
)
assert memory.authoritative is True
assert memory.type == MemoryType.DECISION

Xet Storage Details

Size:
1.55 kB
·
Xet hash:
f9277bfe5e632db985d332d855ddf763e1387e1c37c97b15c9cf67f8b2c8b31b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.