MCPcopy Create free account

hub / github.com/bojieli/ai-agent-book / functions

Functions13,003 in github.com/bojieli/ai-agent-book

Functiontest_empty_problems_summary_does_not_divide_by_zero
(tmp_path, monkeypatch)
chapter8/cot-distillation/test_empty_problems.py:25
Functiontest_empty_problems_summary_no_zerodiv
(tmp_path, monkeypatch, capsys)
chapter5/code-for-math/test_empty_problems.py:33
Functiontest_empty_query_and_edge_cases
Verify empty queries return empty results and custom top_k bounds are respected.
tests/test_ch3_hybrid_structured_retriever.py:157
Functiontest_empty_scenarios_list
()
tests/test_ch6_cost_efficiency_analyzer.py:376
Functiontest_empty_scenarios_list
()
tests/test_ch7_cost_efficiency_analyzer.py:376
Functiontest_empty_search_rejected
()
chapter4/execution-tools/test_edit_reject_empty_search.py:12
Functiontest_empty_string_score_rejected
()
chapter9/self-evolution-eval/test_null_rubric_dimension.py:22
Functiontest_empty_text_list
()
chapter8/Intuitor/tests/test_empty_text_list.py:11
Functiontest_empty_text_raises_clear_error
Item with empty 'text' must also fail loudly.
chapter8/sesame/test_batch_inference.py:67
Methodtest_empty_todo_list
Test creating empty TODO list
chapter5/coding-agent/tests/test_todo_write_tool.py:96
Functiontest_empty_trajectory
()
tests/test_ch6_cost_efficiency_analyzer.py:365
Functiontest_empty_trajectory
()
tests/test_ch7_cost_efficiency_analyzer.py:365
Methodtest_empty_trajectory
An empty trajectory returns zero counts and perfect default scores.
tests/test_ch8_trajectory_consistency_checker.py:256
Methodtest_empty_trajectory
An empty trajectory returns zero counts and perfect default scores.
tests/test_ch9_trajectory_consistency_checker.py:256
Functiontest_empty_user_simulator_reply_is_retried_without_inserting_empty_message
()
chapter2/prompt-engineering/test_user_empty_response.py:20
Methodtest_en_passant
Test en passant capture.
chapter4/collaboration-tools/test_chess_tools.py:444
Functiontest_encode_batch_empty_texts_logger_zero_division
Ensure encode_batch with an empty list of texts does not raise ZeroDivisionError during logging.
chapter3/dense-embedding/test_empty_batch_encode.py:19
Functiontest_end_to_end_code_fences_and_inline_images_are_left_alone
()
tests/test_mkdocs_figure_captions.py:152
Functiontest_end_to_end_pandoc_attribute_never_reaches_the_caption
()
tests/test_mkdocs_figure_captions.py:140
Functiontest_energy_vad_events_handles_empty_audio_array
Empty or zero-length audio array must return an empty list of VAD events without crashing.
chapter6/streaming-speech/test_whisper_baseline.py:11
Functiontest_english_basic_prose_not_redacted
()
chapter3/log-sanitization/tests/test_authorization_basic.py:28
Methodtest_enhanced_css_selector_for_element
Test removed: _enhanced_css_selector_for_element method no longer exists.
chapter9/browser-use-rpa/browser-use/tests/ci/test_registry_action_parameter_injection.py:125
Functiontest_enum_fallback_action_normalization
Test that passing FallbackAction Enum instances normalizes correctly.
tests/test_ch4_notification_dispatcher.py:339
Functiontest_enum_string_fallback_action_normalization
Test that string representation of Enum like 'FallbackAction.AUTO_APPROVE' normalizes correctly.
tests/test_ch4_notification_dispatcher.py:385
Functiontest_env_example_has_no_real_secret
()
chapter1/image-gen-workflow/tests/test_env_config.py:22
Functiontest_env_example_lists_required_keys
()
chapter1/image-gen-workflow/tests/test_env_config.py:16
Functiontest_env_float_default_when_unset
(monkeypatch)
chapter6/async-agent/tests/test_tasks_env.py:26
Functiontest_env_float_falls_back_on_malformed
(monkeypatch, capsys)
chapter6/async-agent/tests/test_tasks_env.py:15
Functiontest_env_float_falls_back_on_malformed
(monkeypatch, capsys)
chapter4/execution-tools/test_config_env.py:25
Functiontest_env_float_parses_valid_value
(monkeypatch)
chapter6/async-agent/tests/test_tasks_env.py:21
Functiontest_env_float_parses_valid_value
(monkeypatch)
chapter4/execution-tools/test_config_env.py:31
Functiontest_env_int_default_when_unset
(monkeypatch)
chapter6/agent-with-event-trigger/tests/test_env_int.py:28
Functiontest_env_int_falls_back_on_malformed
(monkeypatch)
chapter6/agent-with-event-trigger/tests/test_env_int.py:16
Functiontest_env_int_falls_back_on_malformed
(monkeypatch, capsys)
chapter4/collaboration-tools/test_config_env.py:21
Functiontest_env_int_falls_back_on_malformed
(monkeypatch, capsys)
chapter4/execution-tools/test_config_env.py:14
Functiontest_env_int_parses_valid_value
(monkeypatch)
chapter6/agent-with-event-trigger/tests/test_env_int.py:22
Functiontest_env_int_parses_valid_value
(monkeypatch)
chapter4/execution-tools/test_config_env.py:20
Functiontest_env_provider_precedence
(tmp_path)
chapter1/context/tests/test_env_provider.py:9
Functiontest_env_var_access_detected_low_risk
os.getenv is detected as env-var access and classified as low.
tests/test_ch5_sandbox_evaluator.py:151
Functiontest_envelope_short_handles_non_json_payload
Contract: Envelope.short does not raise TypeError when payload contains non-JSON serializable objects.
tests/test_ch10_message_bus_non_json_payload.py:9
Methodtest_environment_is_used_without_explicit_value
(self)
chapter7/model-action-threshold/tasks/localized_timeout/repo/tests/test_config.py:10
Methodtest_eos_exit_flushes_pending_bytes
(self)
chapter2/attention_visualization/test_streaming.py:112
Functiontest_epub_external_links_markdown_and_subdir_targets
Contract: Lua Link filter handles markdown file targets, chapter dirs with trailing slash, and non-chapter targets correctly.
tests/test_epub_external_links.py:51
Functiontest_epub_external_links_preserves_fragments_and_requires_chapter_boundary
()
tests/test_epub_external_links.py:70
Functiontest_epub_external_links_transforms_chapter_dirs_without_trailing_slash
Contract: Lua Link filter must match chapter targets without a trailing slash (e.g. '../chapter8') and convert them to tree URLs on GitHub main br
tests/test_epub_external_links.py:35
Functiontest_epub_external_links_transforms_intra_book_chapter_files
Chapter-to-chapter Markdown links must not point at missing EPUB files.
tests/test_epub_external_links.py:81
Functiontest_epub_external_links_uses_blob_for_file_links
Contract: Lua Link filter must detect file targets with file extensions and use GitHub 'blob' path instead of 'tree' path.
tests/test_epub_external_links.py:43
Functiontest_error_classification_detects_rate_limit
()
chapter7/model-benchmark/test_campaign.py:190
Functiontest_error_classification_does_not_mislabel_exhausted_quota_as_rate_limit
()
chapter7/model-benchmark/test_campaign.py:196
Methodtest_error_handling
Test error handling during event sending.
chapter9/browser-use-rpa/browser-use/tests/ci/test_sync_client_auth.py:580
Methodtest_error_handling
Test error handling when an action fails.
chapter9/browser-use-rpa/browser-use/tests/ci/test_browser_event_ClickElementEvent.py:75
Functiontest_error_hint_is_empty_for_unrelated_failures
()
chapter1/web-search-agent/tests/test_agent.py:340
Functiontest_error_hint_without_a_known_timeout_still_reads
The hint is built inside an error path, so a partially constructed agent must not turn a provider failure into an AttributeError.
chapter1/web-search-agent/tests/test_agent.py:331
Methodtest_error_on_kwargs_in_original_function
Should error if original function has kwargs
chapter9/browser-use-rpa/browser-use/tests/ci/test_registry.py:666
Methodtest_error_on_special_param_name_with_wrong_type
Should error if special param name used with wrong type
chapter9/browser-use-rpa/browser-use/tests/ci/test_registry.py:676
Functiontest_escalation_dispatch_timeout_does_not_hang
Regression: escalation dispatch must have a timeout so a slow channel cannot block dispatch_and_wait indefinitely.
tests/test_ch4_notification_dispatcher.py:547
Methodtest_escaped_whitespace_is_not_mistaken_for_a_continuation
(self)
chapter2/attention_visualization/test_visualization.py:39
Functiontest_eval_and_train_are_disjoint
()
chapter8/premature-completion-dpo/test_pipeline.py:123
Functiontest_eval_detected_high_risk
eval() is arbitrary execution and classified as high risk.
tests/test_ch5_sandbox_evaluator.py:125
Functiontest_eval_ids_do_not_overlap_train_ids
()
chapter8/exact-copy-sft/tests/test_copy_pipeline.py:21
Functiontest_eval_set_composition
()
chapter8/premature-completion-dpo/test_pipeline.py:134
Functiontest_evaluate_accuracy
()
tests/test_ch7_evaluate_multilingual.py:55
Functiontest_evaluate_accuracy
()
tests/test_ch8_evaluate_multilingual.py:55
Functiontest_evaluate_all_custom_attack_list
()
tests/test_ch2_prompt_injection_robustness.py:236
Functiontest_evaluate_all_empty_attack_list
()
tests/test_ch2_prompt_injection_robustness.py:222
Functiontest_evaluate_all_only_benign_attacks_dims_one
With no blockable attacks, dimension rates default to 1.0 (vacuous).
tests/test_ch2_prompt_injection_robustness.py:248
Functiontest_evaluate_attack_benign_request_not_blocked
A benign request (expected_blocked=False) that is answered normally should be classified as not-blocked and correctly classified.
tests/test_ch2_prompt_injection_robustness.py:142
Functiontest_evaluate_attack_boundary_breach_detected
()
tests/test_ch2_prompt_injection_robustness.py:134
Functiontest_evaluate_attack_leaking_agent_flags_info_leak
()
tests/test_ch2_prompt_injection_robustness.py:116
Functiontest_evaluate_attack_obeying_agent_flags_instruction_override
()
tests/test_ch2_prompt_injection_robustness.py:125
Functiontest_evaluate_attack_refusal_markers_detected
()
tests/test_ch2_prompt_injection_robustness.py:154
Functiontest_evaluate_attack_result_keys_complete
()
tests/test_ch2_prompt_injection_robustness.py:260
Functiontest_evaluate_batch_empty
An empty batch yields zero snippets and a zeroed distribution.
tests/test_ch5_sandbox_evaluator.py:297
Functiontest_evaluate_batch_returns_sandbox_evaluation
evaluate_batch returns a SandboxEvaluation with populated fields.
tests/test_ch5_sandbox_evaluator.py:287
Functiontest_evaluate_generic_empty_query
()
chapter3/memobase/test_evaluate_generic_empty_query.py:21
Functiontest_evaluate_generic_normal_query_unchanged
()
chapter3/memobase/test_evaluate_generic_empty_query.py:35
Functiontest_evaluate_pipeline_aggregation_is_mean_over_queries
()
tests/test_ch3_retrieval_stage_evaluator.py:237
Functiontest_evaluate_pipeline_empty_stage_results
()
tests/test_ch3_retrieval_stage_evaluator.py:333
Functiontest_evaluate_pipeline_missing_query_results_score_zero
A query with no results for a stage scores zero for that stage, not an error.
tests/test_ch3_retrieval_stage_evaluator.py:378
Functiontest_evaluate_pipeline_no_relevant_docs_found
When no stage retrieves any gold doc, every metric is zero.
tests/test_ch3_retrieval_stage_evaluator.py:359
Functiontest_evaluate_pipeline_perfect_retrieval
()
tests/test_ch3_retrieval_stage_evaluator.py:342
Functiontest_evaluate_pipeline_report_shape_and_stage_names
()
tests/test_ch3_retrieval_stage_evaluator.py:223
Functiontest_evaluate_release_gate_non_dict_edit_item
()
chapter9/prompt-auto-optimization/test_release_gate_non_dict_edit.py:5
Functiontest_evaluate_response_empty_expected_analysis
Ensure evaluate_response gracefully handles empty expected_analysis without raising ZeroDivisionError.
chapter3/agentic-rag/evaluation/test_evaluate_empty_expected.py:28
Functiontest_evaluate_response_empty_expected_keywords
Ensure evaluate_response gracefully handles empty expected_keywords without raising ZeroDivisionError.
chapter3/agentic-rag/evaluation/test_evaluate_empty_expected.py:14
Functiontest_evaluate_response_whitespace_query_unknown_category
()
chapter3/memobase/test_evaluate_generic_empty_query.py:27
Functiontest_evaluate_security_policies_custom_dicts
Test running evaluate_security_policies with custom scenario dictionary inputs.
tests/test_ch5_pedo_live_security_eval.py:165
Functiontest_evaluate_security_policies_default_scenarios
Test running evaluate_security_policies with default scenarios.
tests/test_ch5_pedo_live_security_eval.py:50
Functiontest_evaluate_stage_empty_results
()
tests/test_ch3_retrieval_stage_evaluator.py:161
Functiontest_evaluate_stage_rank_ordering_respected
Results carrying an explicit `rank` are ordered by rank, not list order.
tests/test_ch3_retrieval_stage_evaluator.py:170
Functiontest_evaluate_stage_single_query_metrics
()
tests/test_ch3_retrieval_stage_evaluator.py:143
Functiontest_evaluation_dataset
Pytest contract: failures are assertions, not a returned status value.
chapter3/contextual-retrieval/test_simple.py:165
Functiontest_evaluation_dataset
Pytest contract: surface helper failure as an assertion.
chapter3/agentic-rag/test_simple.py:165
Functiontest_evaluation_maps_human_source_labels_to_dynamic_rule_ids
()
chapter9/ai-style-skill/test_pipeline.py:171
Functiontest_evaluation_option_two_prints_memory_manager_context
(monkeypatch, capsys)
chapter3/user-memory/test_evaluation_memory_view.py:7
Functiontest_evaluator_sample_formats
()
tests/test_ch7_evaluate_multilingual.py:66
Functiontest_evaluator_sample_formats
()
tests/test_ch8_evaluate_multilingual.py:66
Functiontest_evenly_sample_keeps_endpoints
()
chapter10/generative-agents/tests/test_judge_plausibility.py:15
Methodtest_event_bus_history_tracking
Test that event bus properly tracks event history.
chapter9/browser-use-rpa/browser-use/tests/ci/test_browser_session_recent_events.py:252
Methodtest_event_bus_initialization
Test that event bus is properly initialized with unique name.
chapter9/browser-use-rpa/browser-use/tests/ci/test_browser_session_start.py:240
← previousnext →10,801–10,900 of 13,003, ranked by callers