diff --git a/tests/test_beta_flags.py b/tests/test_beta_flags.py index 4fe2f06..7e312b5 100644 --- a/tests/test_beta_flags.py +++ b/tests/test_beta_flags.py @@ -50,11 +50,12 @@ async def test_beta_flags_collected_from_tools(): tools=tools_with_flags ) - # Check that beta flag was added to headers + # Check that beta flag was added to headers (merged with hardcoded flags) call_args = mock_client.post.call_args headers = call_args[1]["headers"] assert "anthropic-beta" in headers - assert headers["anthropic-beta"] == "computer-use-2025-11-24" + # Should include hardcoded flags + tool flag, sorted alphabetically + assert headers["anthropic-beta"] == "claude-code-20250219,computer-use-2025-11-24,context-management-2025-06-27,oauth-2025-04-20" @pytest.mark.asyncio @@ -99,5 +100,5 @@ async def test_multiple_beta_flags_joined(): call_args = mock_client.post.call_args headers = call_args[1]["headers"] assert "anthropic-beta" in headers - # Should be sorted alphabetically and joined with comma - assert headers["anthropic-beta"] == "flag-a,flag-b" + # Should include hardcoded flags + tool flags, sorted alphabetically and joined with comma + assert headers["anthropic-beta"] == "claude-code-20250219,context-management-2025-06-27,flag-a,flag-b,oauth-2025-04-20" diff --git a/tests/test_oauth_utils.py b/tests/test_oauth_utils.py index c84af4c..75ec75b 100644 --- a/tests/test_oauth_utils.py +++ b/tests/test_oauth_utils.py @@ -17,7 +17,7 @@ def test_get_auth_headers_oauth(): assert "Authorization" in headers assert headers["Authorization"] == "Bearer sk-ant-oat01-xxx" assert "x-api-key" not in headers - assert headers["anthropic-beta"] == "claude-code-20250219,oauth-2025-04-20" + assert headers["anthropic-beta"] == "claude-code-20250219,oauth-2025-04-20,context-management-2025-06-27" def test_get_auth_headers_api_key():