Merge pull request 'fix: update beta flags tests to expect combined hardcoded + tool flags' (#23) from fix/beta-flags-tests into main
Build Nanobot OAuth / build (push) Successful in 21m26s
Build Nanobot OAuth / cleanup (push) Successful in 1s

This commit was merged in pull request #23.
This commit is contained in:
2026-03-05 14:04:04 +01:00
2 changed files with 6 additions and 5 deletions
+5 -4
View File
@@ -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"
+1 -1
View File
@@ -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():