5dca69f0d7
AggregateKind (4 values), MemoryDim (7), AccessPattern (5), Frequency (7), RecommendedDirection (4). All Literal types for stable postfix DSL output (string-valued, no enum-name lookup table needed in the parser). 5 unit tests passing. The 9 supporting dataclasses + the AggregateProfile central artifact go in Tasks 1.2-1.10.
33 lines
1.6 KiB
Python
33 lines
1.6 KiB
Python
"""Tests for src.code_path_audit v2 - Phase 1 (data model)."""
|
|
from src.code_path_audit import (
|
|
AggregateKind,
|
|
MemoryDim,
|
|
AccessPattern,
|
|
Frequency,
|
|
RecommendedDirection,
|
|
)
|
|
|
|
def test_aggregate_kind_4_values() -> None:
|
|
"""AggregateKind is a Literal with 4 values: typealias, dataclass, candidate_dataclass, builtin."""
|
|
expected = {"typealias", "dataclass", "candidate_dataclass", "builtin"}
|
|
assert set(AggregateKind.__args__) == expected
|
|
|
|
def test_memory_dim_7_values() -> None:
|
|
"""MemoryDim is a Literal with 7 values: curation, discussion, rag, knowledge, config, control, unknown."""
|
|
expected = {"curation", "discussion", "rag", "knowledge", "config", "control", "unknown"}
|
|
assert set(MemoryDim.__args__) == expected
|
|
|
|
def test_access_pattern_5_values() -> None:
|
|
"""AccessPattern is a Literal with 5 values: whole_struct, field_by_field, hot_cold_split, bulk_batched, mixed."""
|
|
expected = {"whole_struct", "field_by_field", "hot_cold_split", "bulk_batched", "mixed"}
|
|
assert set(AccessPattern.__args__) == expected
|
|
|
|
def test_frequency_7_values() -> None:
|
|
"""Frequency is a Literal with 7 values: hot, per_turn, per_discussion, per_request, cold, init, unknown."""
|
|
expected = {"hot", "per_turn", "per_discussion", "per_request", "cold", "init", "unknown"}
|
|
assert set(Frequency.__args__) == expected
|
|
|
|
def test_recommended_direction_4_values() -> None:
|
|
"""RecommendedDirection is a Literal with 4 values: componentize, unify, hold, insufficient_data."""
|
|
expected = {"componentize", "unify", "hold", "insufficient_data"}
|
|
assert set(RecommendedDirection.__args__) == expected |