Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
9,455 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
9,455
◇
Types & classes
3,151
↳
Endpoints
25
Method
test_detection
(self, shape: Callable[..., Any])
tests/lib/test_credentials.py:3463
Function
test_dict_of_union
()
tests/test_models.py:361
Method
test_different_region
(self)
tests/lib/test_bedrock_mantle.py:39
Method
test_different_service_name
Mantle uses a different service name for SigV4 signing.
tests/lib/test_aws_auth.py:455
Function
test_directly_nested_model
()
tests/test_models.py:25
Function
test_disabled_mode_never_deletes_but_still_syncs
( tmp_path: Path, clock: Clock, caplog: pytest.LogCaptureFixture )
tests/lib/tools/memory_sync/test_delete_discipline.py:87
Function
test_discriminated_union_case
()
tests/test_models.py:942
Function
test_discriminated_unions_invalid_data
()
tests/test_models.py:657
Function
test_discriminated_unions_invalid_data_nested_unions
()
tests/test_models.py:713
Function
test_discriminated_unions_invalid_data_uses_cache
()
tests/test_models.py:799
Function
test_discriminated_unions_overlapping_discriminators_invalid_data
()
tests/test_models.py:779
Function
test_discriminated_unions_pep604_uses_cache
()
tests/test_models.py:836
Function
test_discriminated_unions_unknown_variant
()
tests/test_models.py:690
Function
test_discriminated_unions_with_aliases_invalid_data
()
tests/test_models.py:746
Function
test_dispatches_builtin_and_custom_tools_in_one_stream
A single stream carrying both an `agent.tool_use` and an `agent.custom_tool_use` dispatches both, each answered with its matching result-event
tests/lib/tools/test_session_runner.py:464
Function
test_dispose_keeps_a_folder_that_fails_the_marker_check
Sync left the folder as found after a failed marker check; teardown must not then delete the files sync refused to touch.
tests/lib/tools/memory_sync/test_folder_trust.py:213
Function
test_dispose_never_raises_when_a_store_root_is_replaced_by_a_file
The worker calls dispose() from its teardown: a store whose folder something replaced with a regular file must log and be skipped, not raise o
tests/lib/tools/memory_sync/test_folder_trust.py:230
Function
test_dispose_tolerates_an_already_deleted_folder
(tmp_path: Path)
tests/lib/tools/memory_sync/test_folder_trust.py:203
Method
test_docstring_parsing_simple
Test that simple docstrings still work correctly.
tests/lib/tools/test_functions.py:418
Method
test_docstring_parsing_with_parameters
(self, docstring: str)
tests/lib/tools/test_functions.py:331
Function
test_does_not_coerce_int
()
tests/test_models.py:443
Method
test_does_not_duplicate_a_beta_already_on_the_request
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:613
Function
test_does_not_mutate_parent_client
Building the sub-client must not touch the parent's auth state. Without this, a long-lived parent client could be silently re-credentialed ev
tests/lib/test_scoped_client.py:54
Function
test_does_not_mutate_the_wire_delta_when_inserting_at_a_new_index
()
tests/lib/sessions/test_accumulate.py:129
Function
test_does_not_run_a_call_that_confirm_declines_or_the_toolsets_calls_after_it
( setup: SetupFactory, family: str )
tests/lib/tools/test_runner_eager_toolsets.py:154
Function
test_does_not_run_a_call_that_has_not_started_when_the_caller_leaves_the_loop
( setup: SetupFactory, )
tests/lib/tools/test_runner_eager_toolsets.py:282
Function
test_does_not_run_a_held_call_once_one_of_its_toolsets_calls_has_failed
(setup: SetupFactory)
tests/lib/tools/test_runner_eager_toolsets.py:299
Method
test_does_not_tag_requests_it_passes_through
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:662
Function
test_does_not_wait_for_the_reply_to_end
(setup: SetupFactory)
tests/lib/tools/test_runner_eager_tools.py:312
Function
test_dot_segment_rejected
(template: str, kwargs: dict[str, Any])
tests/test_utils/test_path.py:87
Function
test_double_nested_union
()
tests/test_models.py:381
Function
test_download_paths_reach_the_model_only_through_an_exposing_file_policy
()
tests/lib/tools/toolsets/test_enforcement.py:276
Function
test_download_paths_reach_the_model_only_through_an_exposing_file_policy_on_the_async_class
()
tests/lib/tools/toolsets/test_enforcement.py:549
Function
test_download_paths_stay_hidden_on_the_async_class_without_a_file_policy
()
tests/lib/tools/toolsets/test_pipeline.py:1357
Function
test_download_retrieves_by_configured_version_and_downloads_by_returned_id
(tmp_path: Path)
tests/lib/tools/test_skills.py:407
Function
test_driver_tool_error_is_the_error_text_and_any_other_exception_is_reported_too
()
tests/lib/tools/toolsets/test_pipeline.py:514
Function
test_driver_values_are_validated_where_the_driver_builds_them_and_forwarded_as_built
()
tests/lib/tools/toolsets/test_pipeline.py:1137
Function
test_driver_values_reach_the_block_as_built_on_the_async_class
()
tests/lib/tools/toolsets/test_pipeline.py:1490
Method
test_duck_typed_token_is_rejected
(self)
tests/lib/test_credentials.py:3002
Method
test_each_hop_patches_the_original_params_not_the_previous_hop
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:367
Function
test_edit_binary_raises_tool_error
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:581
Function
test_edit_custom_max_bytes_allows_above_default
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:410
Function
test_edit_custom_max_bytes_rejects_below_cap
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:401
Function
test_edit_normal_within_limit
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:393
Function
test_edit_preserves_crlf_line_endings
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:268
Function
test_edit_rejects_directory
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:385
Function
test_edit_rejects_directory_even_when_uncapped
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:425
Function
test_edit_rejects_oversized_file
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:376
Function
test_edit_uncapped_allows_oversized
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:418
Function
test_edit_uniqueness
(tmp_path: Path, description: str, args: dict[str, object], want_error: bool)
tests/lib/tools/test_agent_toolset.py:641
Function
test_edits_flow_both_ways_and_the_server_wins_conflicts
( tmp_path: Path, caplog: pytest.LogCaptureFixture )
tests/lib/tools/memory_sync/test_memory_sync.py:42
Function
test_elsewhere_a_device_named_file_is_an_ordinary_file
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/toolsets/test_security.py:225
Method
test_embedded_resource_image
(self)
tests/lib/tools/test_mcp_tool.py:131
Method
test_embedded_resource_image_requires_blob
(self)
tests/lib/tools/test_mcp_tool.py:160
Method
test_embedded_resource_no_mime_defaults_to_text
(self)
tests/lib/tools/test_mcp_tool.py:148
Method
test_embedded_resource_pdf
(self)
tests/lib/tools/test_mcp_tool.py:123
Method
test_embedded_resource_pdf_requires_blob
(self)
tests/lib/tools/test_mcp_tool.py:165
Method
test_embedded_resource_text
(self)
tests/lib/tools/test_mcp_tool.py:116
Method
test_embedded_resource_unsupported_mime
(self)
tests/lib/tools/test_mcp_tool.py:155
Function
test_empty
()
tests/test_qs.py:11
Method
test_empty_access_token_treated_as_missing
(self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:4375
Function
test_empty_auth_token_raises
An empty `auth_token` would silently fall back to the parent's `auth_token` via `copy()`'s truthy-or, producing a sub-client with no intention
tests/lib/test_scoped_client.py:65
Method
test_empty_betas_sends_no_beta_header
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:604
Method
test_empty_contents_raises
(self)
tests/lib/tools/test_mcp_tool.py:234
Method
test_empty_contents_raises
(self)
tests/lib/tools/test_mcp_tool.py:280
Method
test_empty_env_auth_token_is_unset
`ANTHROPIC_AUTH_TOKEN=` (present but empty) must not produce a malformed `Authorization: Bearer ` header alongside the api key.
tests/lib/test_credentials.py:4252
Method
test_empty_env_credentials_fall_through_to_no_auth
Both env vars empty → same "no auth configured" error as unset, rather than sending empty `X-Api-Key` / `Authorization: Bearer `.
tests/lib/test_credentials.py:4266
Method
test_empty_path_raises
(self, tmp_path: pathlib.Path)
tests/lib/test_credentials.py:1498
Method
test_empty_paths_returns_same_object
(self)
tests/test_files.py:149
Method
test_empty_pointer_file_is_silent_fallthrough
( self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:4327
Function
test_empty_query_params_are_left_unset
(send: Send, caplog: pytest.LogCaptureFixture)
tests/test_prepare.py:503
Method
test_empty_refresh_token_treated_as_missing
( self, clean_env: pytest.MonkeyPatch, tmp_path: pathlib.Path )
tests/lib/test_credentials.py:4386
Function
test_enabling_an_unimplemented_member_is_a_configuration_error
()
tests/lib/tools/toolsets/test_pipeline.py:461
Function
test_enabling_file_upload_or_javascript_exec_requires_confirm
()
tests/lib/tools/toolsets/test_confirm.py:74
Function
test_enabling_javascript_exec_or_file_upload_requires_a_confirm_callable
()
tests/lib/tools/toolsets/test_pipeline.py:487
Function
test_endless_nesting_is_rejected
(send: Send, monkeypatch: pytest.MonkeyPatch)
tests/test_prepare.py:336
Method
test_entry_overrides_apply_to_the_hop_request
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:1266
Method
test_entry_overrides_are_merged_whole_over_the_body
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:306
Function
test_enum_schema
()
tests/lib/_parse/test_transform.py:64
Function
test_env_api_key
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:294
Method
test_env_api_key_alone_does_not_warn
No shadow if there's nothing to shadow — env api_key alone (no auto-discoverable credential signals) is just the normal path.
tests/lib/test_credentials.py:4238
Method
test_env_api_key_returns_false
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:85
Method
test_env_api_key_shadows_env_federation_trio_with_warning
Env `ANTHROPIC_API_KEY` + env federation trio → api_key wins (step 2 beats step 4), warn so the user knows WIF is being shadowed.
tests/lib/test_credentials.py:4210
Method
test_env_api_key_shadows_env_profile_with_warning
( self, clean_env: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture )
tests/lib/test_credentials.py:4227
Function
test_env_base_url
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:308
Function
test_env_base_url_does_not_override_derived_url
(respx_mock: MockRouter, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:916
Function
test_env_base_url_does_not_override_derived_url_async
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:934
Method
test_env_federation_beats_fallback_on_disk_profile
Step 4 (env federation trio) sits above step 5 (fallback on-disk profile) in the precedence spec: a machine with WIF env vars wired up
tests/lib/test_credentials.py:2209
Method
test_env_fills_missing_organization_id
(self, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_credentials.py:1403
Method
test_env_fills_missing_workspace_id
(self, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_credentials.py:1445
Method
test_env_overrides_active_config
(self, tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_credentials.py:980
Function
test_env_region
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:302
Method
test_env_resolution
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_google_cloud.py:116
Method
test_env_takes_precedence_over_region
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:398
Method
test_env_var_base_url_override
Test that ANTHROPIC_VERTEX_BASE_URL environment variable does not override client arg.
tests/lib/test_vertex.py:208
Method
test_env_var_base_url_override
Test that ANTHROPIC_VERTEX_BASE_URL environment variable does not override client arg.
tests/lib/test_vertex.py:404
Method
test_env_var_fallback_chain
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:424
Method
test_env_var_fallback_chain_falls_through
Falls back to second env var when first is not set.
tests/lib/test_aws_auth.py:188
Method
test_env_var_fallback_chain_falls_through
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:268
Method
test_env_var_fallback_chain_falls_through
(self, monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws_auth.py:352
← previous
next →
4,601–4,700 of 9,455, ranked by callers