Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
12,274 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
12,274
◇
Types & classes
3,937
↳
Endpoints
46
Function
test_filestore_get_returns_none_when_absent
(store: FileStore)
tests/lib/tools/test_file_store.py:152
Function
test_filestore_hash_file_hashes_one_file_and_shares_the_cache
( store: FileStore, monkeypatch: pytest.MonkeyPatch )
tests/lib/tools/test_file_store.py:241
Function
test_filestore_hashtree_distrusts_fresh_stamps
Filesystems stamp times with coarse clocks, so a same-tick rewrite can reuse the exact stat identity of the version just hashed. A file whose
tests/lib/tools/test_file_store.py:461
Function
test_filestore_hashtree_hashes_regular_files_and_skips_symlinks
(tmp_path: Path, store: FileStore)
tests/lib/tools/test_file_store.py:196
Function
test_filestore_hashtree_refuses_a_symlinked_prefix
A prefix that is a symlink (here to a directory outside the root) is refused, not silently listed as empty.
tests/lib/tools/test_file_store.py:228
Function
test_filestore_hashtree_rehashes_only_what_changed
A file whose stat identity (mtime, ctime, size) is unchanged since the last walk is served from the cache; a changed file is re-read. The trust
tests/lib/tools/test_file_store.py:419
Function
test_filestore_is_path_legal
()
tests/lib/tools/test_file_store.py:411
Function
test_filestore_listings_raise_on_an_unreadable_subdirectory
An unreadable subdirectory fails the listing rather than dropping out of it.
tests/lib/tools/test_file_store.py:209
Function
test_filestore_ls_lists_recursively_and_never_descends_symlinks
(tmp_path: Path, store: FileStore)
tests/lib/tools/test_file_store.py:159
Function
test_filestore_move_never_creates_a_missing_root
(store: FileStore)
tests/lib/tools/test_file_store.py:549
Function
test_filestore_move_renames_within_root_and_refuses_existing_dest
(store: FileStore)
tests/lib/tools/test_file_store.py:269
Function
test_filestore_open_raises_on_an_unreadable_mount_path
A mount path the process cannot stat raises at open — it is never read as absent, which would mark a real directory ours to remove on dispose.
tests/lib/tools/test_file_store.py:319
Function
test_filestore_put_executable_sets_owner_exec
(store: FileStore)
tests/lib/tools/test_file_store.py:58
Function
test_filestore_put_is_atomic_and_leaves_no_temp_on_success
(store: FileStore)
tests/lib/tools/test_file_store.py:64
Function
test_filestore_put_never_creates_a_missing_root
Only create_root() makes the folder: a put into a store that was never created, or whose folder was removed, raises and re-creates nothing — not
tests/lib/tools/test_file_store.py:516
Function
test_filestore_put_refuses_a_directory_rel
(store: FileStore, bad: str)
tests/lib/tools/test_file_store.py:376
Function
test_filestore_put_writes_archive_bytes_verbatim
Archive-shaped bytes land as a single byte-identical file — extraction is never inferred from the content.
tests/lib/tools/test_file_store.py:361
Function
test_filestore_put_writes_text_and_creates_owner_only_parents
`put` creates nested parents 0o700 and stores text as UTF-8 (file 0o600).
tests/lib/tools/test_file_store.py:47
Function
test_filestore_remove_deletes_file_and_subtree
(store: FileStore)
tests/lib/tools/test_file_store.py:298
Function
test_filestore_remove_unlinks_a_dangling_symlink
(store: FileStore)
tests/lib/tools/test_file_store.py:310
Function
test_filestore_root_path_is_banned_from_the_interface
A rel_path resolving to the root: put/get refuse, move/remove do nothing.
tests/lib/tools/test_file_store.py:281
Function
test_filestore_utf8_restriction_refuses_binary_content
A store opened with `utf8_only=True` refuses binary content on both verbs that touch it: a put of invalid bytes writes nothing, and a get of a
tests/lib/tools/test_file_store.py:383
Function
test_finish_runs_once_and_a_second_call_raises
(tmp_path: Path)
tests/lib/tools/memory_sync/test_delete_discipline.py:242
Method
test_first_call_fetches
(self)
tests/lib/test_credentials.py:1600
Method
test_first_send_creates_a_thread_with_the_seed_and_the_new_messages
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:115
Function
test_flush_adopts_a_file_the_server_already_holds
A final sync cut off after uploading a file leaves the baseline stale; the flush sees the server already has those bytes and records that inst
tests/lib/tools/memory_sync/test_final_flush.py:172
Function
test_flush_never_pushes_a_read_only_store
(tmp_path: Path)
tests/lib/tools/memory_sync/test_final_flush.py:192
Function
test_flush_never_raises
(tmp_path: Path, caplog: pytest.LogCaptureFixture)
tests/lib/tools/memory_sync/test_final_flush.py:240
Function
test_flush_pushes_new_and_changed_files_and_nothing_else
( tmp_path: Path, caplog: pytest.LogCaptureFixture )
tests/lib/tools/memory_sync/test_final_flush.py:37
Function
test_flush_pushes_nothing_when_the_marker_check_fails
( tmp_path: Path, caplog: pytest.LogCaptureFixture )
tests/lib/tools/memory_sync/test_final_flush.py:221
Function
test_flush_skips_files_the_server_already_refused
(tmp_path: Path)
tests/lib/tools/memory_sync/test_final_flush.py:205
Function
test_flush_uploads_several_files_at_once_up_to_the_bound
Two uploads are in flight together, and never more than the bound — a serial flush would time out waiting for the second to start.
tests/lib/tools/memory_sync/test_final_flush.py:92
Method
test_follow_redirects
(self, respx_mock: MockRouter, client: Anthropic)
tests/test_client.py:1517
Method
test_follow_redirects
(self, respx_mock: MockRouter, async_client: AsyncAnthropic)
tests/test_client.py:3004
Method
test_follow_redirects_disabled
(self, respx_mock: MockRouter, client: Anthropic)
tests/test_client.py:1529
Method
test_follow_redirects_disabled
(self, respx_mock: MockRouter, async_client: AsyncAnthropic)
tests/test_client.py:3016
Method
test_for_base_url
The first bind (and re-binds to the same host) happen in place; a bind to another host yields a separate provider and leaves the origi
tests/lib/test_credentials.py:1250
Method
test_for_base_url_federation_profile
A second host gets its own provider exchanging there; the original keeps exchanging at the first host, and only the original uses the
tests/lib/test_credentials.py:463
Method
test_for_base_url_http_rejected
(self)
tests/lib/test_credentials.py:1270
Method
test_for_base_url_returns_self_when_bind_is_moot
No per-host provider is made when the bind can't change where the tokens come from: the profile pins its own `base_url`, or it is a us
tests/lib/test_credentials.py:496
Method
test_fork_and_original_continue_independently
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1356
Method
test_fork_and_original_continue_independently
(self, respx_mock: MockRouter)
tests/lib/threads/test_async_beta_threads.py:181
Method
test_fork_creates_a_thread_with_the_full_history_and_the_same_fields
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1333
Method
test_fork_during_a_turn_has_the_history_that_set_messages_params_replaced_the_threads_with
( self, respx_mock: MockRouter )
tests/lib/threads/test_thread_tool_runner.py:237
Method
test_fork_during_a_turn_has_the_history_that_set_messages_params_replaced_the_threads_with
( self, respx_mock: MockRouter )
tests/lib/threads/test_async_beta_threads.py:1262
Function
test_fork_during_build_does_not_block_child
()
tests/test_models.py:1213
Method
test_fork_keeps_the_unsupported_request_behavior
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1346
Method
test_fork_of_a_thread_that_ends_in_a_partial_reply_sends_it_ahead_of_a_new_message
( self, respx_mock: MockRouter )
tests/lib/threads/test_beta_threads.py:1410
Method
test_fork_of_a_thread_that_ends_in_a_partial_reply_sends_it_ahead_of_a_new_message
( self, respx_mock: MockRouter )
tests/lib/threads/test_async_beta_threads.py:235
Method
test_fork_of_a_thread_that_ends_in_a_partial_reply_sends_the_turn_again_without_it
( self, respx_mock: MockRouter, forks: int, method: str )
tests/lib/threads/test_beta_threads.py:1380
Method
test_fork_of_a_thread_that_ends_in_a_partial_reply_sends_the_turn_again_without_it
( self, respx_mock: MockRouter, forks: int, method: str )
tests/lib/threads/test_async_beta_threads.py:205
Method
test_fork_of_a_thread_that_ends_in_a_whole_reply_sends_the_full_history_with_no_new_message
( self, respx_mock: MockRouter )
tests/lib/threads/test_beta_threads.py:1423
Method
test_fork_of_a_thread_that_ends_in_a_whole_reply_sends_the_full_history_with_no_new_message
( self, respx_mock: MockRouter )
tests/lib/threads/test_async_beta_threads.py:248
Method
test_fork_returns_a_thread_with_no_previous_message_id_without_a_request
(self, respx_mock: MockRouter)
tests/lib/threads/test_beta_threads.py:1321
Function
test_forwards_compat_model_dump_json_method
()
tests/test_models.py:618
Function
test_forwards_compat_model_dump_method
()
tests/test_models.py:554
Method
test_foundry_clients_accept_middleware
(self)
tests/test_middleware.py:2107
Method
test_foundry_runner_threads_by_default
(self, respx_mock: MockRouter)
tests/lib/threads/test_tool_runner_threading.py:860
Method
test_fresh_token_not_refetched
(self)
tests/lib/test_credentials.py:1649
Method
test_full_fixture_tool_wire
(self, respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:1467
Method
test_full_surface_present
(self)
tests/lib/test_google_cloud.py:382
Method
test_function_call_with_invalid_input
( self, input_data: dict[str, Any], expected_error_type: type[BaseException], expected_error_msg: str
tests/lib/tools/test_functions.py:111
Method
test_function_call_with_valid_input
(self)
tests/lib/tools/test_functions.py:78
Method
test_function_with_multiple_types
Test function schema conversion with various Python types.
tests/lib/tools/test_functions.py:43
Method
test_function_without_docstring
(self)
tests/lib/tools/test_functions.py:190
Method
test_function_without_type_hints
(self)
tests/lib/tools/test_functions.py:198
Method
test_functional_middleware
(self, respx_mock: MockRouter)
tests/test_middleware.py:776
Method
test_functional_middleware
(self, respx_mock: MockRouter)
tests/test_middleware.py:1510
Method
test_generator_body_survives_retries
( self, respx_mock: MockRouter, client: Anthropic | AsyncAnthropic, monkeypatch: pytest.MonkeyPatch
tests/test_prepare.py:815
Function
test_get_does_not_prepare_a_body
(send: Send, monkeypatch: pytest.MonkeyPatch)
tests/test_prepare.py:568
Method
test_get_platform
(self)
tests/test_client.py:2938
Method
test_get_token_rejects_async_provider
(self)
tests/lib/test_credentials.py:1632
Function
test_given_tracer_provider_is_asked_at_the_first_call
Whatever the registered provider does.
tests/test_tracing.py:371
Function
test_gives_the_timing_from_before_when_the_caller_defers_every_call
(setup: SetupFactory)
tests/lib/tools/test_runner_eager_tools.py:417
Function
test_glob_and_grep_reach_an_allowed_root
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/test_agent_toolset.py:1256
Function
test_glob_drops_matches_that_cannot_be_canonicalised
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:1143
Function
test_glob_mtime_order
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:656
Function
test_glob_post_filters_symlink_escape
A symlink traversed mid-pattern must not let a glob result escape the workdir.
tests/lib/tools/test_agent_toolset.py:1128
Function
test_glob_rejects_dotdot_pattern
`Path.glob` honours literal `..` segments — the tool must reject a pattern that would walk out of the workdir before it ever runs.
tests/lib/tools/test_agent_toolset.py:1114
Function
test_glob_with_path
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:671
Method
test_global_region_base_url
Test that global region uses the correct base URL.
tests/lib/test_vertex.py:353
Method
test_global_region_base_url
Test that global region uses the correct base URL.
tests/lib/test_vertex.py:874
Method
test_global_tracer_provider_that_cannot_be_loaded_leaves_platform_clients_without_spans
( self, spans: Spans, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture )
tests/test_open_telemetry.py:8126
Method
test_global_tracer_provider_that_cannot_be_loaded_leaves_the_client_without_spans
( self, sync: bool, spans: Spans, respx_mock: MockRouter, caplog: pytest.LogCaptureFixture )
tests/test_open_telemetry.py:8102
Method
test_google_credentials_exposed_without_shadowing_base_attribute
(self)
tests/lib/test_google_cloud.py:372
Function
test_grep_does_not_pass_anthropic_variables_to_rg
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/test_agent_toolset.py:773
Function
test_grep_finds_match
(tmp_path: Path)
tests/lib/tools/test_agent_toolset.py:787
Function
test_grep_ignores_relative_path_entries
( tmp_path: Path, monkeypatch: pytest.MonkeyPatch, relative_entry: str )
tests/lib/tools/test_agent_toolset.py:685
Function
test_grep_ignores_the_ripgrep_config_file
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/test_agent_toolset.py:1186
Function
test_grep_passes_no_config_to_rg
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/test_agent_toolset.py:1201
Function
test_grep_passes_over_an_rg_inside_the_workdir_or_an_allowed_root
( tmp_path: Path, monkeypatch: pytest.MonkeyPatch, entry: str )
tests/lib/tools/test_agent_toolset.py:729
Function
test_grep_runs_no_rg_when_an_allowed_root_cannot_be_resolved
( tmp_path: Path, monkeypatch: pytest.MonkeyPatch )
tests/lib/tools/test_agent_toolset.py:755
Function
test_grep_runs_the_rg_named_for_the_platform
( tmp_path: Path, monkeypatch: pytest.MonkeyPatch, os_name: str, expected: str )
tests/lib/tools/test_agent_toolset.py:709
Function
test_grep_single_file_path
Fallback walker must handle a file path, not just directories.
tests/lib/tools/test_agent_toolset.py:796
Function
test_grep_skips_symlinked_files
The fallback walker must not read through a symlink that escapes the workdir.
tests/lib/tools/test_agent_toolset.py:1153
Function
test_grep_walk_leaves_the_hosts_signal_alone
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/test_agent_toolset.py:824
Function
test_grep_walk_stops_a_backtracking_pattern
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/test_agent_toolset.py:809
Function
test_grep_walk_works_off_the_main_thread
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/test_agent_toolset.py:861
Function
test_grep_walk_works_without_interval_timers
( tmp_path: Path, monkeypatch: pytest.MonkeyPatch, error: type[Exception] )
tests/lib/tools/test_agent_toolset.py:847
Function
test_grep_without_rg_reads_only_regular_files
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
tests/lib/tools/test_agent_toolset.py:1169
← previous
next →
6,301–6,400 of 12,274, ranked by callers