mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-29 06:33:28 +00:00
test(guardrails): drop the wall-clock check from the deep tool arguments unit test
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
The integration test test_deeply_nested_tool_arguments_do_not_stall_the_worker already covers the timing; the unit test keeps the redaction check.
This commit is contained in:
parent
6106f34854
commit
ef7868515f
1 changed files with 1 additions and 3 deletions
|
|
@ -99,7 +99,7 @@ async def test_tool_arguments_native_hook_cannot_forward_unredacted_credentials(
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_deeply_nested_tool_arguments_are_scanned_in_bounded_time():
|
||||
async def test_deeply_nested_tool_arguments_are_redacted():
|
||||
arguments = '{"k":' * 200 + json.dumps(f"AWS_ACCESS_KEY_ID={AWS_KEY}") + "}" * 200
|
||||
data = {
|
||||
"messages": [
|
||||
|
|
@ -109,9 +109,7 @@ async def test_deeply_nested_tool_arguments_are_scanned_in_bounded_time():
|
|||
}
|
||||
]
|
||||
}
|
||||
started = time.perf_counter()
|
||||
await _guardrail().async_pre_call_hook(UserAPIKeyAuth(), DualCache(), data, "acompletion")
|
||||
assert time.perf_counter() - started < 3.0
|
||||
rewritten = data["messages"][0]["tool_calls"][0]["function"]["arguments"]
|
||||
assert json.loads(rewritten) == json.loads(arguments.replace(AWS_KEY, "[REDACTED]"))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue