mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-13 08:52:02 +00:00
test(anthropic): keep the header merge regression test clear of main's appended tests
This commit is contained in:
parent
af175185e1
commit
ff4e80ca65
1 changed files with 12 additions and 12 deletions
|
|
@ -4692,6 +4692,18 @@ def test_requires_native_compaction_beta_is_false_without_a_signal(
|
|||
assert requires_native_compaction_beta(provider, optional_params, messages) is False
|
||||
|
||||
|
||||
def test_merge_header_sources_keeps_only_the_string_betas_of_a_mixed_list() -> None:
|
||||
merged: Final = merge_header_sources(
|
||||
{"anthropic-beta": ["context-1m-2025-08-07", b"bytes-beta", ("nested",), object(), 3]},
|
||||
{"Anthropic-Beta": "message-threads-2026-08-12", "x-other": "kept"},
|
||||
)
|
||||
|
||||
assert dict(merged) == {
|
||||
"anthropic-beta": "context-1m-2025-08-07,message-threads-2026-08-12",
|
||||
"x-other": "kept",
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("custom_llm_provider", "model", "expected"),
|
||||
[
|
||||
|
|
@ -4733,15 +4745,3 @@ def test_tools_without_strict_drops_only_the_strict_key_and_counts_the_strict_to
|
|||
assert tools_without_strict(tools) == ToolsWithoutStrict(
|
||||
tools=({"name": "a"}, {"name": "b"}, {"name": "c"}), dropped_count=1
|
||||
)
|
||||
|
||||
|
||||
def test_merge_header_sources_keeps_only_the_string_betas_of_a_mixed_list() -> None:
|
||||
merged: Final = merge_header_sources(
|
||||
{"anthropic-beta": ["context-1m-2025-08-07", b"bytes-beta", ("nested",), object(), 3]},
|
||||
{"Anthropic-Beta": "message-threads-2026-08-12", "x-other": "kept"},
|
||||
)
|
||||
|
||||
assert dict(merged) == {
|
||||
"anthropic-beta": "context-1m-2025-08-07,message-threads-2026-08-12",
|
||||
"x-other": "kept",
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue