MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / predicate

Function predicate

tests/lib/tools/toolsets/test_enforcement.py:128–129  ·  view source on GitHub ↗
(ctx: BetaURLContext, url: str)

Source from the content-addressed store, hash-verified

126
127def test_a_predicate_shaped_or_async_policy_on_the_sync_class_is_a_contract_error() -> None:
128 def predicate(ctx: BetaURLContext, url: str) -> Any:
129 return False
130
131 with pytest.raises(ToolsetContractError, match="return None to allow.*; got bool"):
132 FakeBrowser(url_policy=predicate).call(CTX, "navigate", {"url": "https://example.com/"})

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected