From 6ff31af6c53da4dbd201d211687ebe720b568e84 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Thu, 25 Jun 2026 13:11:44 -0400 Subject: [PATCH] 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. --- tests/test_token_viz.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test_token_viz.py b/tests/test_token_viz.py index 1f0af0b2..8f9fa8f2 100644 --- a/tests/test_token_viz.py +++ b/tests/test_token_viz.py @@ -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") \ No newline at end of file + """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") \ No newline at end of file