fix(test): update test_token_viz to verify provider_state API (not aliases)
Phase 7 alias removal exposed test_token_viz::test_anthropic_history_lock_accessible
which asserted the old aliases (_anthropic_history, _anthropic_history_lock) exist
on the ai_client module. After Phase 7 those aliases are intentionally gone.
Updated test to:
- Verify the new provider_state.get_history('anthropic') pattern (lock + messages attributes)
- Verify the old aliases are NOT present (positive assertion that migration is complete)
This is the canonical post-migration test pattern.
This commit is contained in:
@@ -85,6 +85,10 @@ def test_gemini_cache_fields_accessible() -> None:
|
||||
assert hasattr(ai_client, "_GEMINI_CACHE_TTL")
|
||||
|
||||
def test_anthropic_history_lock_accessible() -> None:
|
||||
"""_anthropic_history_lock must be accessible for cache hint rendering."""
|
||||
assert hasattr(ai_client, "_anthropic_history_lock")
|
||||
assert hasattr(ai_client, "_anthropic_history")
|
||||
"""provider_state.get_history('anthropic').lock must be accessible for cache hint rendering."""
|
||||
from src import provider_state
|
||||
hist = provider_state.get_history("anthropic")
|
||||
assert hasattr(hist, "lock")
|
||||
assert hasattr(hist, "messages")
|
||||
assert not hasattr(ai_client, "_anthropic_history_lock")
|
||||
assert not hasattr(ai_client, "_anthropic_history")
|
||||
Reference in New Issue
Block a user