RagLeap
Tests

Tests: ragleap-tools

Test files: 21. Test functions: 337. Described by their authors (docstring or @DisplayName): 2. Where there is no description, the line shows the test name in words and says so.

Latest result: ragleap-tools-tests (3.10) passed 526 passed, 0 skipped, 0 failed CI job ragleap-tools-tests (3.11) passed 526 passed, 0 skipped, 0 failed CI job ragleap-tools-tests (3.12) passed 526 passed, 0 skipped, 0 failed CI job

test_base_additions.py — 6 tests 6 passed, 0 failed, 0 skipped

v0.5.0 additions to Tool: metadata, to_anthropic_schema, ToolError.

  • test_four_positional_arguments_still_construct_a_tool passed
    Four positional arguments still construct a tool (no description in the source; shown from the name)
  • test_metadata_defaults_to_an_independent_dict passed
    Metadata defaults to an independent dict (no description in the source; shown from the name)
  • test_metadata_is_stored_as_given passed
    Metadata is stored as given (no description in the source; shown from the name)
  • test_anthropic_schema_shape passed
    Anthropic schema shape (no description in the source; shown from the name)
  • test_metadata_never_appears_in_provider_schemas passed
    Metadata never appears in provider schemas (no description in the source; shown from the name)
  • test_tool_error_is_an_exception_with_its_message passed
    Tool error is an exception with its message (no description in the source; shown from the name)
test_calculator.py — 12 tests 12 passed, 0 failed, 0 skipped

No file-level description in the source.

  • test_basic_arithmetic passed
    Basic arithmetic (no description in the source; shown from the name)
  • test_functions_and_constants passed
    Functions and constants (no description in the source; shown from the name)
  • test_division_by_zero passed
    Division by zero (no description in the source; shown from the name)
  • test_empty_expression passed
    Empty expression (no description in the source; shown from the name)
  • test_expression_too_long passed
    Expression too long (no description in the source; shown from the name)
  • test_rejects_import_call passed
    Rejects import call (no description in the source; shown from the name)
  • test_rejects_attribute_access passed
    Rejects attribute access (no description in the source; shown from the name)
  • test_rejects_arbitrary_names passed
    Rejects arbitrary names (no description in the source; shown from the name)
  • test_rejects_list_comprehension passed
    Rejects list comprehension (no description in the source; shown from the name)
  • test_rejects_multi_statement passed
    Rejects multi statement (no description in the source; shown from the name)
  • test_tool_schema_shape passed
    Tool schema shape (no description in the source; shown from the name)
  • test_tool_call_matches_direct_call passed
    Tool call matches direct call (no description in the source; shown from the name)
test_datetime_tools.py — 5 tests 5 passed, 0 failed, 0 skipped

No file-level description in the source.

  • test_get_current_datetime_succeeds passed
    Get current datetime succeeds (no description in the source; shown from the name)
  • test_add_days passed
    Add days (no description in the source; shown from the name)
  • test_subtract_via_negative passed
    Subtract via negative (no description in the source; shown from the name)
  • test_date_difference passed
    Date difference (no description in the source; shown from the name)
  • test_invalid_datetime_string passed
    Invalid datetime string (no description in the source; shown from the name)
test_file_ops.py — 11 tests 11 passed, 0 failed, 0 skipped

No file-level description in the source.

  • test_write_then_read passed
    Write then read (no description in the source; shown from the name)
  • test_write_creates_parent_dirs passed
    Write creates parent dirs (no description in the source; shown from the name)
  • test_read_nonexistent_file passed
    Read nonexistent file (no description in the source; shown from the name)
  • test_read_directory_as_file_fails passed
    Read directory as file fails (no description in the source; shown from the name)
  • test_path_escape_rejected_on_read passed
    Path escape rejected on read (no description in the source; shown from the name)
  • test_path_escape_rejected_on_write passed
    Path escape rejected on write (no description in the source; shown from the name)
  • test_symlink_escape_rejected passed
    Symlink escape rejected (no description in the source; shown from the name)
  • test_list_files passed
    List files (no description in the source; shown from the name)
  • test_list_files_shows_subdirs_with_trailing_slash passed
    List files shows subdirs with trailing slash (no description in the source; shown from the name)
  • test_write_content_too_large passed
    Write content too large (no description in the source; shown from the name)
  • test_make_file_tools_returns_three_bound_tools passed
    Make file tools returns three bound tools (no description in the source; shown from the name)
test_github_search.py — 14 tests 14 passed, 0 failed, 0 skipped

Tests for ragleap_tools.github_search - GitHubSearchConfig, search_github_repositories(), and make_github_search_tool(). Mocks urllib.request.urlopen directly so the real URL/header construction is exercised, mirroring test_web_search.py's approach for the two SearchProvider implementations.

  • test_returns_normalized_results passed
    Returns normalized results (no description in the source; shown from the name)
  • test_handles_missing_description_and_language passed
    Handles missing description and language (no description in the source; shown from the name)
  • test_no_token_sends_no_authorization_header passed
    No token sends no authorization header (no description in the source; shown from the name)
  • test_token_sends_bearer_authorization_header passed
    Token sends bearer authorization header (no description in the source; shown from the name)
  • test_always_sends_user_agent passed
    Always sends user agent (no description in the source; shown from the name)
  • test_builds_correct_query_params passed
    Builds correct query params (no description in the source; shown from the name)
  • test_omits_sort_param_when_not_given passed
    Omits sort param when not given (no description in the source; shown from the name)
  • test_clamps_num_results_to_maximum passed
    Clamps num results to maximum (no description in the source; shown from the name)
  • test_rejects_non_integer_num_results_without_making_request passed
    Rejects non integer num results without making request (no description in the source; shown from the name)
  • test_http_error_surfaces_status_and_body passed
    Http error surfaces status and body (no description in the source; shown from the name)
  • test_network_error_is_caught passed
    Network error is caught (no description in the source; shown from the name)
  • test_make_tool_returns_bound_tool passed
    Make tool returns bound tool (no description in the source; shown from the name)
  • test_make_tool_has_valid_openai_schema passed
    Make tool has valid openai schema (no description in the source; shown from the name)
  • test_make_tool_has_valid_gemini_schema passed
    Make tool has valid gemini schema (no description in the source; shown from the name)
test_governed.py — 61 tests 61 passed, 0 failed, 0 skipped

GovernedToolkit: scope, allowlist, rate limit, approval and audit events.

  • test_a_toolkit_is_required passed
    A toolkit is required (no description in the source; shown from the name)
  • test_allow_for_must_be_callable passed
    Allow for must be callable (no description in the source; shown from the name)
  • test_require_approval_must_be_a_list_of_names passed
    Require approval must be a list of names (no description in the source; shown from the name)
  • test_require_approval_entries_must_be_strings_and_known_tools passed
    Require approval entries must be strings and known tools (no description in the source; shown from the name)
  • test_require_approval_accepts_list_tuple_set_and_frozenset passed
    Require approval accepts list tuple set and frozenset (no description in the source; shown from the name)
  • test_other_options_are_checked passed
    Other options are checked (no description in the source; shown from the name)
  • test_a_look_alike_or_subclass_of_ratelimit_is_refused passed
    A look alike or subclass of ratelimit is refused (no description in the source; shown from the name)
  • test_ratelimit_calls_must_be_a_positive_integer passed
    Ratelimit calls must be a positive integer (no description in the source; shown from the name)
  • test_ratelimit_per_seconds_must_be_a_positive_number passed
    Ratelimit per seconds must be a positive number (no description in the source; shown from the name)
  • test_ratelimit_accepts_ints_and_floats_and_is_frozen passed
    Ratelimit accepts ints and floats and is frozen (no description in the source; shown from the name)
  • test_governance_config_error_is_a_value_error passed
    Governance config error is a value error (no description in the source; shown from the name)
  • test_fallback_scope_key_and_fields passed
    Fallback scope key and fields (no description in the source; shown from the name)
  • test_fallback_scope_refuses_bad_parts passed
    Fallback scope refuses bad parts (no description in the source; shown from the name)
  • test_fallback_scope_accepts_the_edge_cases passed
    Fallback scope accepts the edge cases (no description in the source; shown from the name)
  • test_scope_errors_are_value_errors passed
    Scope errors are value errors (no description in the source; shown from the name)
  • test_the_real_scope_agrees_with_the_fallback passed
    The real scope agrees with the fallback (no description in the source; shown from the name)
  • test_call_refuses_anything_that_is_not_exactly_a_scope_and_runs_nothing passed
    Call refuses anything that is not exactly a scope and runs nothing (no description in the source; shown from the name)
  • test_an_invalid_scope_is_reported_without_tenant_fields passed
    An invalid scope is reported without tenant fields (no description in the source; shown from the name)
  • test_an_allowed_tool_runs_like_toolkit_call passed
    An allowed tool runs like toolkit call (no description in the source; shown from the name)
  • test_allow_for_gets_the_scope_and_decides_per_scope passed
    Allow for gets the scope and decides per scope (no description in the source; shown from the name)
  • test_allow_for_may_return_a_list_tuple_set_or_frozenset passed
    Allow for may return a list tuple set or frozenset (no description in the source; shown from the name)
  • test_a_tool_that_is_not_named_is_not_available_and_not_run passed
    A tool that is not named is not available and not run (no description in the source; shown from the name)
  • test_unknown_and_not_allowed_tools_get_the_same_answer_and_event passed
    Unknown and not allowed tools get the same answer and event (no description in the source; shown from the name)
  • test_a_name_that_allow_for_lists_but_the_toolkit_lacks_is_not_available passed
    A name that allow for lists but the toolkit lacks is not available (no description in the source; shown from the name)
  • test_a_name_that_is_not_a_string_is_not_available passed
    A name that is not a string is not available (no description in the source; shown from the name)
  • test_allow_for_returning_anything_else_fails_closed passed
    Allow for returning anything else fails closed (no description in the source; shown from the name)
  • test_allow_for_raising_fails_closed_and_logs_only_the_exception_type passed
    Allow for raising fails closed and logs only the exception type (no description in the source; shown from the name)
  • test_the_empty_allowlist_allows_nothing passed
    The empty allowlist allows nothing (no description in the source; shown from the name)
  • test_calls_over_the_limit_are_refused_and_the_handler_does_not_run passed
    Calls over the limit are refused and the handler does not run (no description in the source; shown from the name)
  • test_the_window_slides_and_a_hit_exactly_one_window_old_is_dropped passed
    The window slides and a hit exactly one window old is dropped (no description in the source; shown from the name)
  • test_refused_calls_do_not_extend_the_window passed
    Refused calls do not extend the window (no description in the source; shown from the name)
  • test_tenants_have_separate_windows_and_subjects_of_one_tenant_share_one passed
    Tenants have separate windows and subjects of one tenant share one (no description in the source; shown from the name)
  • test_forget_resets_one_tenant_or_all_and_counts_the_windows passed
    Forget resets one tenant or all and counts the windows (no description in the source; shown from the name)
  • test_calls_that_are_refused_before_the_limit_do_not_use_up_quota passed
    Calls that are refused before the limit do not use up quota (no description in the source; shown from the name)
  • test_calls_with_invalid_arguments_do_count_against_the_limit passed
    Calls with invalid arguments do count against the limit (no description in the source; shown from the name)
  • test_without_a_rate_limit_calls_are_unlimited passed
    Without a rate limit calls are unlimited (no description in the source; shown from the name)
  • test_the_limit_holds_under_concurrent_calls passed
    The limit holds under concurrent calls (no description in the source; shown from the name)
  • test_two_governed_toolkits_on_one_toolkit_keep_separate_windows passed
    Two governed toolkits on one toolkit keep separate windows (no description in the source; shown from the name)
  • test_tools_that_need_no_approval_never_call_approve passed
    Tools that need no approval never call approve (no description in the source; shown from the name)
  • test_an_approved_call_runs passed
    An approved call runs (no description in the source; shown from the name)
  • test_only_exactly_true_approves passed
    Only exactly true approves (no description in the source; shown from the name)
  • test_an_approve_hook_that_raises_denies_and_logs_only_the_type passed
    An approve hook that raises denies and logs only the type (no description in the source; shown from the name)
  • test_a_tool_that_needs_approval_is_refused_when_no_approve_was_given passed
    A tool that needs approval is refused when no approve was given (no description in the source; shown from the name)
  • test_approve_gets_the_scope_the_tool_and_the_validated_arguments passed
    Approve gets the scope the tool and the validated arguments (no description in the source; shown from the name)
  • test_arguments_that_fail_validation_never_reach_approve passed
    Arguments that fail validation never reach approve (no description in the source; shown from the name)
  • test_arguments_that_cannot_be_copied_for_approve_are_denied_and_never_raise passed
    Arguments that cannot be copied for approve are denied and never raise (no description in the source; shown from the name)
  • test_approve_cannot_change_what_runs_by_editing_its_copy_of_the_arguments passed
    Approve cannot change what runs by editing its copy of the arguments (no description in the source; shown from the name)
  • test_approve_edits_to_nested_arguments_do_not_reach_the_handler_either passed
    Approve edits to nested arguments do not reach the handler either (no description in the source; shown from the name)
  • test_invalid_arguments_return_the_same_failure_toolkit_call_returns passed
    Invalid arguments return the same failure toolkit call returns (no description in the source; shown from the name)
  • test_handler_failures_pass_through_unchanged passed
    Handler failures pass through unchanged (no description in the source; shown from the name)
  • test_null_optional_arguments_are_dropped_before_the_handler_like_toolkit_call_does passed
    Null optional arguments are dropped before the handler like toolkit call does (no description in the source; shown from the name)
  • test_the_wrapped_toolkit_is_not_changed passed
    The wrapped toolkit is not changed (no description in the source; shown from the name)
  • test_with_everything_allowed_and_no_policy_it_matches_toolkit_call_for_known_tools passed
    With everything allowed and no policy it matches toolkit call for known tools (no description in the source; shown from the name)
  • test_every_call_attempt_produces_exactly_one_event_with_these_fields passed
    Every call attempt produces exactly one event with these fields (no description in the source; shown from the name)
  • test_event_values_for_each_outcome passed
    Event values for each outcome (no description in the source; shown from the name)
  • test_a_failing_event_hook_never_breaks_the_call_and_logs_only_the_type passed
    A failing event hook never breaks the call and logs only the type (no description in the source; shown from the name)
  • test_the_event_is_a_fresh_dict_each_time passed
    The event is a fresh dict each time (no description in the source; shown from the name)
  • test_no_hook_means_no_event_work_and_nothing_is_logged passed
    No hook means no event work and nothing is logged (no description in the source; shown from the name)
  • test_canary_strings_never_reach_an_event_or_a_refusal passed
    Canary strings never reach an event or a refusal (no description in the source; shown from the name)
  • test_call_never_raises_for_odd_input passed
    Call never raises for odd input (no description in the source; shown from the name)
  • test_governed_toolkit_is_exported_from_the_package passed
    Governed toolkit is exported from the package (no description in the source; shown from the name)
test_http.py — 22 tests 22 passed, 0 failed, 0 skipped

Tests for ragleap_tools._http.fetch against a real local HTTP server.

  • test_defaults_are_the_documented_values passed
    Defaults are the documented values (no description in the source; shown from the name)
  • test_returns_the_body passed
    Returns the body (no description in the source; shown from the name)
  • test_exactly_at_the_limit_passes_and_one_over_fails passed
    Exactly at the limit passes and one over fails (no description in the source; shown from the name)
  • test_declared_oversize_is_rejected_without_waiting_for_the_body passed
    Declared oversize is rejected without waiting for the body (no description in the source; shown from the name)
  • test_oversize_with_content_length passed
    Oversize with content length (no description in the source; shown from the name)
  • test_oversize_chunked_without_content_length passed
    Oversize chunked without content length (no description in the source; shown from the name)
  • test_chunked_body_within_the_limit_is_decoded passed
    Chunked body within the limit is decoded (no description in the source; shown from the name)
  • test_slow_drip_body_hits_the_total_deadline passed
    Slow drip body hits the total deadline (no description in the source; shown from the name)
  • test_stalled_body_hits_the_deadline passed
    Stalled body hits the deadline (no description in the source; shown from the name)
  • test_server_that_never_answers_hits_the_deadline passed
    Server that never answers hits the deadline (no description in the source; shown from the name)
  • test_worker_thread_exits_soon_after_the_deadline passed
    Worker thread exits soon after the deadline (no description in the source; shown from the name)
  • test_error_types_are_urlerrors_with_readable_text passed
    Error types are urlerrors with readable text (no description in the source; shown from the name)
  • test_http_error_body_is_capped_and_still_readable passed
    Http error body is capped and still readable (no description in the source; shown from the name)
  • test_small_http_error_body_is_preserved passed
    Small http error body is preserved (no description in the source; shown from the name)
  • test_http_error_with_a_dripping_body_hits_the_deadline passed
    Http error with a dripping body hits the deadline (no description in the source; shown from the name)
  • test_truncated_body_is_reported passed
    Truncated body is reported (no description in the source; shown from the name)
  • test_connection_refused_is_a_urlerror passed
    Connection refused is a urlerror (no description in the source; shown from the name)
  • test_other_exceptions_propagate_unchanged passed
    Other exceptions propagate unchanged (no description in the source; shown from the name)
  • test_stand_in_responses_without_a_real_read1_still_work passed
    Stand in responses without a real read1 still work (no description in the source; shown from the name)
  • test_urlopen_gets_the_per_operation_timeout passed
    Urlopen gets the per operation timeout (no description in the source; shown from the name)
  • test_validate_limits_rejects_bad_values passed
    Validate limits rejects bad values (no description in the source; shown from the name)
  • test_validate_limits_accepts_the_edges passed
    Validate limits accepts the edges (no description in the source; shown from the name)
test_http_providers.py — 9 tests 9 passed, 0 failed, 0 skipped

End-to-end: every network provider through the real urllib path against a local server. Size cap, total deadline, config validation, per-operation timeout.

  • test_works_end_to_end_over_real_urllib passed
    Works end to end over real urllib (no description in the source; shown from the name)
  • test_oversized_response_is_a_clean_error passed
    Oversized response is a clean error (no description in the source; shown from the name)
  • test_slow_drip_returns_at_the_total_deadline passed
    Slow drip returns at the total deadline (no description in the source; shown from the name)
  • test_configured_limits_are_stored_and_defaults_documented passed
    Configured limits are stored and defaults documented (no description in the source; shown from the name)
  • test_bad_limits_are_rejected_at_construction passed
    Bad limits are rejected at construction (no description in the source; shown from the name)
  • test_github_http_error_body_is_still_surfaced passed
    Github http error body is still surfaced (no description in the source; shown from the name)
  • test_github_huge_error_body_is_bounded passed
    Github huge error body is bounded (no description in the source; shown from the name)
  • test_per_operation_timeouts_are_unchanged passed
    Per operation timeouts are unchanged (no description in the source; shown from the name)
  • test_vision_per_operation_timeout_is_unchanged passed
    Vision per operation timeout is unchanged (no description in the source; shown from the name)
test_ingest.py — 6 tests 6 passed, 0 failed, 0 skipped

Tests for ragleap_tools.ingest - ingest_document() and make_ingest_tool(). Uses a fake RagLeap stand-in rather than a real instance, same approach as test_search.py: ingest_text()'s own correctness is ragleap-rag's job (already tested there); this module's job is the Tool/ToolResult wiring and the metadata threading around it, which a fake exercises just as well without a live vector backend or embedding provider.

  • test_ingest_document_passes_filename_as_metadata passed
    The real bug this fix closes: metadata was never threaded
  • test_ingest_document_returns_document_id_and_chunks_stored passed
    Ingest document returns document id and chunks stored (no description in the source; shown from the name)
  • test_ingest_document_catches_value_error passed
    Ingest document catches value error (no description in the source; shown from the name)
  • test_make_ingest_tool_returns_bound_tool passed
    Make ingest tool returns bound tool (no description in the source; shown from the name)
  • test_make_ingest_tool_has_valid_openai_schema passed
    Make ingest tool has valid openai schema (no description in the source; shown from the name)
  • test_make_ingest_tool_has_valid_gemini_schema passed
    Make ingest tool has valid gemini schema (no description in the source; shown from the name)
test_json_csv.py — 4 tests 4 passed, 0 failed, 0 skipped

No file-level description in the source.

  • test_parse_valid_json passed
    Parse valid json (no description in the source; shown from the name)
  • test_parse_invalid_json passed
    Parse invalid json (no description in the source; shown from the name)
  • test_parse_csv_with_header passed
    Parse csv with header (no description in the source; shown from the name)
  • test_parse_csv_without_header passed
    Parse csv without header (no description in the source; shown from the name)
test_public_api.py — 6 tests 6 passed, 0 failed, 0 skipped

Tests for the package's public __init__.py surface - the actual API a real caller interacts with, not just individual modules.

  • test_version_is_exposed passed
    Version is exposed (no description in the source; shown from the name)
  • test_stateless_tools_all_have_valid_openai_schemas passed
    Stateless tools all have valid openai schemas (no description in the source; shown from the name)
  • test_stateless_tools_all_have_valid_gemini_schemas passed
    Stateless tools all have valid gemini schemas (no description in the source; shown from the name)
  • test_stateless_tool_names_are_unique passed
    Stateless tool names are unique (no description in the source; shown from the name)
  • test_web_search_names_are_exported passed
    Web search names are exported (no description in the source; shown from the name)
  • test_github_search_names_are_exported passed
    Github search names are exported (no description in the source; shown from the name)
test_schema_validation.py — 30 tests 30 passed, 0 failed, 0 skipped

validate_arguments / drop_null_optionals: the argument checks that run before a handler.

  • test_valid_arguments_pass passed
    Valid arguments pass (no description in the source; shown from the name)
  • test_missing_required_argument_is_named passed
    Missing required argument is named (no description in the source; shown from the name)
  • test_unknown_argument_is_rejected_when_properties_are_declared passed
    Unknown argument is rejected when properties are declared (no description in the source; shown from the name)
  • test_unknown_argument_allowed_when_additional_properties_true passed
    Unknown argument allowed when additional properties true (no description in the source; shown from the name)
  • test_unknown_argument_allowed_when_schema_has_no_properties passed
    Unknown argument allowed when schema has no properties (no description in the source; shown from the name)
  • test_additional_properties_false_rejects_extras_even_without_properties passed
    Additional properties false rejects extras even without properties (no description in the source; shown from the name)
  • test_additional_properties_schema_validates_extras passed
    Additional properties schema validates extras (no description in the source; shown from the name)
  • test_wrong_types_are_rejected passed
    Wrong types are rejected (no description in the source; shown from the name)
  • test_bool_is_not_an_integer_or_number passed
    Bool is not an integer or number (no description in the source; shown from the name)
  • test_number_accepts_int_and_float passed
    Number accepts int and float (no description in the source; shown from the name)
  • test_non_finite_numbers_are_rejected passed
    Non finite numbers are rejected (no description in the source; shown from the name)
  • test_type_list_accepts_any_listed_type passed
    Type list accepts any listed type (no description in the source; shown from the name)
  • test_unknown_schema_type_fails_closed passed
    Unknown schema type fails closed (no description in the source; shown from the name)
  • test_enum_accepts_listed_and_rejects_others passed
    Enum accepts listed and rejects others (no description in the source; shown from the name)
  • test_enum_does_not_confuse_true_with_one passed
    Enum does not confuse true with one (no description in the source; shown from the name)
  • test_string_length_limits passed
    String length limits (no description in the source; shown from the name)
  • test_numeric_limits passed
    Numeric limits (no description in the source; shown from the name)
  • test_array_limits_and_items_are_checked_with_an_index passed
    Array limits and items are checked with an index (no description in the source; shown from the name)
  • test_nested_object_required_and_unknown_keys passed
    Nested object required and unknown keys (no description in the source; shown from the name)
  • test_nested_extra_keys_are_allowed_by_default passed
    Nested extra keys are allowed by default (no description in the source; shown from the name)
  • test_deep_nesting_returns_an_error_not_a_recursion_error passed
    Deep nesting returns an error not a recursion error (no description in the source; shown from the name)
  • test_nesting_within_the_limit_is_accepted passed
    Nesting within the limit is accepted (no description in the source; shown from the name)
  • test_arguments_must_be_a_dict passed
    Arguments must be a dict (no description in the source; shown from the name)
  • test_non_string_argument_names_are_rejected passed
    Non string argument names are rejected (no description in the source; shown from the name)
  • test_a_non_dict_schema_accepts_any_object passed
    A non dict schema accepts any object (no description in the source; shown from the name)
  • test_error_text_clips_long_and_control_characters passed
    Error text clips long and control characters (no description in the source; shown from the name)
  • test_keywords_outside_the_subset_are_ignored passed
    Keywords outside the subset are ignored (no description in the source; shown from the name)
  • test_drop_null_optionals_drops_only_optional_non_null_properties passed
    Drop null optionals drops only optional non null properties (no description in the source; shown from the name)
  • test_drop_null_optionals_without_properties_is_a_no_op passed
    Drop null optionals without properties is a no op (no description in the source; shown from the name)
  • test_drop_null_optionals_does_not_mutate_the_input passed
    Drop null optionals does not mutate the input (no description in the source; shown from the name)
test_search.py — 12 tests 12 passed, 0 failed, 0 skipped

Tests for ragleap_tools.search - search_documents() and make_search_tool(). Uses a fake RagLeap stand-in rather than a real instance: retrieve()'s own correctness is ragleap-rag's job (already tested there); this module's job is the Tool/ToolResult wiring around it, which a fake exercises just as well without a live vector backend.

  • test_search_documents_returns_chunks_unmodified passed
    Search documents returns chunks unmodified (no description in the source; shown from the name)
  • test_search_documents_passes_through_top_k_and_rerank passed
    Search documents passes through top k and rerank (no description in the source; shown from the name)
  • test_search_documents_always_uses_hybrid_retrieval passed
    Search documents always uses hybrid retrieval (no description in the source; shown from the name)
  • test_search_documents_returns_empty_result_for_no_matches passed
    Search documents returns empty result for no matches (no description in the source; shown from the name)
  • test_search_documents_catches_unexpected_errors passed
    Search documents catches unexpected errors (no description in the source; shown from the name)
  • test_make_search_tool_returns_bound_tool passed
    Make search tool returns bound tool (no description in the source; shown from the name)
  • test_make_search_tool_has_valid_openai_schema passed
    Make search tool has valid openai schema (no description in the source; shown from the name)
  • test_make_search_tool_has_valid_gemini_schema passed
    Make search tool has valid gemini schema (no description in the source; shown from the name)
  • test_search_documents_passes_filename_as_metadata_filter passed
    Search documents passes filename as metadata filter (no description in the source; shown from the name)
  • test_search_documents_without_filename_passes_no_metadata_filter passed
    Confirms the default (no filename=) path is unchanged - the
  • test_make_search_tool_schema_includes_optional_filename passed
    Make search tool schema includes optional filename (no description in the source; shown from the name)
  • test_make_search_tool_call_with_filename_passes_through passed
    Make search tool call with filename passes through (no description in the source; shown from the name)
test_text_utils.py — 5 tests 5 passed, 0 failed, 0 skipped

No file-level description in the source.

  • test_regex_extract passed
    Regex extract (no description in the source; shown from the name)
  • test_regex_extract_invalid_pattern passed
    Regex extract invalid pattern (no description in the source; shown from the name)
  • test_word_count passed
    Word count (no description in the source; shown from the name)
  • test_case_transforms passed
    Case transforms (no description in the source; shown from the name)
  • test_unknown_mode_rejected passed
    Unknown mode rejected (no description in the source; shown from the name)
test_tool_call.py — 4 tests 4 passed, 0 failed, 0 skipped

No file-level description in the source.

  • test_an_argument_named_self_reaches_the_handler passed
    An argument named self reaches the handler (no description in the source; shown from the name)
  • test_normal_calls_still_work passed
    Normal calls still work (no description in the source; shown from the name)
  • test_arguments_must_still_be_keywords passed
    Arguments must still be keywords (no description in the source; shown from the name)
  • test_self_is_positional_only_in_the_signature passed
    Self is positional only in the signature (no description in the source; shown from the name)
test_tool_decorator.py — 25 tests 25 passed, 0 failed, 0 skipped

The @tool decorator: schema generation, definition errors and call behaviour.

  • test_schema_comes_from_annotations_and_google_docstring passed
    Schema comes from annotations and google docstring (no description in the source; shown from the name)
  • test_name_and_description_overrides passed
    Name and description overrides (no description in the source; shown from the name)
  • test_both_decorator_forms_work passed
    Both decorator forms work (no description in the source; shown from the name)
  • test_misuse_of_the_decorator_is_rejected passed
    Misuse of the decorator is rejected (no description in the source; shown from the name)
  • test_invalid_or_missing_names_are_rejected passed
    Invalid or missing names are rejected (no description in the source; shown from the name)
  • test_a_description_is_required_and_capped passed
    A description is required and capped (no description in the source; shown from the name)
  • test_docstring_with_only_sections_needs_an_explicit_description passed
    Docstring with only sections needs an explicit description (no description in the source; shown from the name)
  • test_metadata_is_copied_and_kept passed
    Metadata is copied and kept (no description in the source; shown from the name)
  • test_original_function_is_reachable passed
    Original function is reachable (no description in the source; shown from the name)
  • test_provider_schemas_do_not_carry_metadata passed
    Provider schemas do not carry metadata (no description in the source; shown from the name)
  • test_supported_annotations passed
    Supported annotations (no description in the source; shown from the name)
  • test_pep604_optional_syntax passed
    Pep604 optional syntax (no description in the source; shown from the name)
  • test_definition_errors passed
    Definition errors (no description in the source; shown from the name)
  • test_success_wraps_the_return_value passed
    Success wraps the return value (no description in the source; shown from the name)
  • test_a_returned_tool_result_passes_through passed
    A returned tool result passes through (no description in the source; shown from the name)
  • test_invalid_arguments_never_reach_the_function passed
    Invalid arguments never reach the function (no description in the source; shown from the name)
  • test_null_for_an_optional_argument_means_omitted passed
    Null for an optional argument means omitted (no description in the source; shown from the name)
  • test_null_for_a_required_argument_is_invalid passed
    Null for a required argument is invalid (no description in the source; shown from the name)
  • test_tool_error_message_reaches_the_model_collapsed passed
    Tool error message reaches the model collapsed (no description in the source; shown from the name)
  • test_tool_error_with_no_message_uses_a_generic_one passed
    Tool error with no message uses a generic one (no description in the source; shown from the name)
  • test_long_tool_error_is_capped passed
    Long tool error is capped (no description in the source; shown from the name)
  • test_unexpected_exception_exposes_only_the_type_and_is_logged passed
    Unexpected exception exposes only the type and is logged (no description in the source; shown from the name)
  • test_expose_errors_includes_the_message passed
    Expose errors includes the message (no description in the source; shown from the name)
  • test_keyboard_interrupt_is_not_swallowed passed
    Keyboard interrupt is not swallowed (no description in the source; shown from the name)
  • test_an_argument_named_self_is_rejected_cleanly_not_with_a_type_error passed
    An argument named self is rejected cleanly not with a type error (no description in the source; shown from the name)
test_toolkit.py — 31 tests 31 passed, 0 failed, 0 skipped

Toolkit: collection, selection, schema export and safe dispatch.

  • test_add_chains_and_lists_names_in_order passed
    Add chains and lists names in order (no description in the source; shown from the name)
  • test_duplicate_names_and_non_tools_are_rejected passed
    Duplicate names and non tools are rejected (no description in the source; shown from the name)
  • test_select_include_exclude_where passed
    Select include exclude where (no description in the source; shown from the name)
  • test_select_unknown_names_raise_instead_of_silently_dropping passed
    Select unknown names raise instead of silently dropping (no description in the source; shown from the name)
  • test_select_keeps_the_argument_size_limit_and_returns_a_new_toolkit passed
    Select keeps the argument size limit and returns a new toolkit (no description in the source; shown from the name)
  • test_select_by_metadata passed
    Select by metadata (no description in the source; shown from the name)
  • test_schema_exports_have_the_three_provider_shapes passed
    Schema exports have the three provider shapes (no description in the source; shown from the name)
  • test_max_arguments_chars_must_be_a_positive_integer passed
    Max arguments chars must be a positive integer (no description in the source; shown from the name)
  • test_call_with_a_json_string_a_dict_or_nothing passed
    Call with a json string a dict or nothing (no description in the source; shown from the name)
  • test_call_does_not_mutate_the_callers_dict passed
    Call does not mutate the callers dict (no description in the source; shown from the name)
  • test_unknown_tool_names_fail_cleanly passed
    Unknown tool names fail cleanly (no description in the source; shown from the name)
  • test_bad_json_or_non_object_json_fails_without_reaching_the_handler passed
    Bad json or non object json fails without reaching the handler (no description in the source; shown from the name)
  • test_arguments_of_the_wrong_python_type_fail passed
    Arguments of the wrong python type fail (no description in the source; shown from the name)
  • test_non_string_argument_names_fail passed
    Non string argument names fail (no description in the source; shown from the name)
  • test_oversize_arguments_fail_before_parsing passed
    Oversize arguments fail before parsing (no description in the source; shown from the name)
  • test_a_json_bomb_fails_cleanly passed
    A json bomb fails cleanly (no description in the source; shown from the name)
  • test_arguments_failing_the_schema_never_reach_the_handler passed
    Arguments failing the schema never reach the handler (no description in the source; shown from the name)
  • test_missing_required_arguments_fail passed
    Missing required arguments fail (no description in the source; shown from the name)
  • test_null_for_an_optional_argument_is_dropped_before_the_handler passed
    Null for an optional argument is dropped before the handler (no description in the source; shown from the name)
  • test_unexpected_handler_exceptions_are_contained_and_type_only passed
    Unexpected handler exceptions are contained and type only (no description in the source; shown from the name)
  • test_tool_error_from_a_plain_tool_reaches_the_model passed
    Tool error from a plain tool reaches the model (no description in the source; shown from the name)
  • test_a_handler_returning_the_wrong_type_is_reported passed
    A handler returning the wrong type is reported (no description in the source; shown from the name)
  • test_the_handlers_own_result_object_is_returned_unchanged passed
    The handlers own result object is returned unchanged (no description in the source; shown from the name)
  • test_an_argument_named_self_reaches_a_schema_free_tool passed
    An argument named self reaches a schema free tool (no description in the source; shown from the name)
  • test_decorated_tools_work_through_the_toolkit passed
    Decorated tools work through the toolkit (no description in the source; shown from the name)
  • test_every_builtin_tool_has_a_sample_call passed
    Every builtin tool has a sample call (no description in the source; shown from the name)
  • test_builtin_tools_accept_valid_calls_through_the_toolkit passed
    Builtin tools accept valid calls through the toolkit (no description in the source; shown from the name)
  • test_builtin_tools_reject_invalid_calls_without_raising passed
    Builtin tools reject invalid calls without raising (no description in the source; shown from the name)
  • test_null_optional_arguments_work_for_builtin_tools passed
    Null optional arguments work for builtin tools (no description in the source; shown from the name)
  • test_default_toolkit_is_a_fresh_copy_of_the_stateless_tools passed
    Default toolkit is a fresh copy of the stateless tools (no description in the source; shown from the name)
  • test_the_new_names_are_exported passed
    The new names are exported (no description in the source; shown from the name)
test_toolkit_prepare_run.py — 20 tests 20 passed, 0 failed, 0 skipped

Toolkit.prepare and Toolkit.run: the two halves of Toolkit.call.

  • test_prepare_returns_the_registered_tool_and_a_new_arguments_dict passed
    Prepare returns the registered tool and a new arguments dict (no description in the source; shown from the name)
  • test_prepare_accepts_a_json_string_a_dict_or_nothing passed
    Prepare accepts a json string a dict or nothing (no description in the source; shown from the name)
  • test_prepare_never_runs_the_handler passed
    Prepare never runs the handler (no description in the source; shown from the name)
  • test_prepare_drops_null_optional_arguments_like_call_does passed
    Prepare drops null optional arguments like call does (no description in the source; shown from the name)
  • test_prepare_returns_the_failed_result_call_would_return passed
    Prepare returns the failed result call would return (no description in the source; shown from the name)
  • test_prepare_reports_a_missing_required_argument passed
    Prepare reports a missing required argument (no description in the source; shown from the name)
  • test_prepare_enforces_the_size_limit_before_parsing passed
    Prepare enforces the size limit before parsing (no description in the source; shown from the name)
  • test_run_runs_the_handler_with_keyword_arguments passed
    Run runs the handler with keyword arguments (no description in the source; shown from the name)
  • test_run_goes_through_tool_call_like_the_old_call_did passed
    Run goes through tool call like the old call did (no description in the source; shown from the name)
  • test_run_passes_an_argument_literally_named_self passed
    Run passes an argument literally named self (no description in the source; shown from the name)
  • test_run_turns_tool_error_into_a_failed_result_with_the_message passed
    Run turns tool error into a failed result with the message (no description in the source; shown from the name)
  • test_run_contains_unexpected_exceptions_and_keeps_the_detail_out_of_the_result passed
    Run contains unexpected exceptions and keeps the detail out of the result (no description in the source; shown from the name)
  • test_run_fails_cleanly_when_the_handler_returns_something_else passed
    Run fails cleanly when the handler returns something else (no description in the source; shown from the name)
  • test_run_refuses_a_tool_that_is_not_in_this_toolkit_and_does_not_run_it passed
    Run refuses a tool that is not in this toolkit and does not run it (no description in the source; shown from the name)
  • test_run_refuses_values_that_are_not_tools passed
    Run refuses values that are not tools (no description in the source; shown from the name)
  • test_run_refuses_arguments_that_are_not_a_dict passed
    Run refuses arguments that are not a dict (no description in the source; shown from the name)
  • test_run_refuses_non_string_argument_names passed
    Run refuses non string argument names (no description in the source; shown from the name)
  • test_a_tool_shared_with_a_selected_toolkit_can_be_run_by_either passed
    A tool shared with a selected toolkit can be run by either (no description in the source; shown from the name)
  • test_a_tool_renamed_after_it_was_added_still_works_under_its_registered_name passed
    A tool renamed after it was added still works under its registered name (no description in the source; shown from the name)
  • test_call_is_prepare_followed_by_run passed
    Call is prepare followed by run (no description in the source; shown from the name)
test_unit_conversion.py — 6 tests 6 passed, 0 failed, 0 skipped

No file-level description in the source.

  • test_length_km_to_miles passed
    Length km to miles (no description in the source; shown from the name)
  • test_length_unknown_unit passed
    Length unknown unit (no description in the source; shown from the name)
  • test_weight_kg_to_lb passed
    Weight kg to lb (no description in the source; shown from the name)
  • test_temperature_c_to_f passed
    Temperature c to f (no description in the source; shown from the name)
  • test_temperature_f_to_c passed
    Temperature f to c (no description in the source; shown from the name)
  • test_temperature_below_absolute_zero_rejected passed
    Temperature below absolute zero rejected (no description in the source; shown from the name)
test_vision.py — 33 tests 33 passed, 0 failed, 0 skipped

Tests for ragleap_tools.vision - image-type detection, the describe_image() validation order, the two reference providers, and make_vision_tool(). A FakeVisionProvider records every call so tests assert on what was actually passed through (and that rejected inputs never reach the provider); urllib.request.urlopen is mocked directly for the provider tests so each provider's real URL/header/body construction is exercised, not bypassed.

  • test_detect_mime_type_known_formats passed
    Detect mime type known formats (no description in the source; shown from the name)
  • test_detect_mime_type_unknown_and_short passed
    Detect mime type unknown and short (no description in the source; shown from the name)
  • test_describe_image_success_passes_bytes_type_and_default_prompt passed
    Describe image success passes bytes type and default prompt (no description in the source; shown from the name)
  • test_describe_image_passes_custom_prompt_through passed
    Describe image passes custom prompt through (no description in the source; shown from the name)
  • test_blank_prompt_falls_back_to_default passed
    Blank prompt falls back to default (no description in the source; shown from the name)
  • test_type_is_detected_from_bytes_not_extension passed
    Type is detected from bytes not extension (no description in the source; shown from the name)
  • test_description_is_stripped passed
    Description is stripped (no description in the source; shown from the name)
  • test_prompt_too_long_rejected passed
    Prompt too long rejected (no description in the source; shown from the name)
  • test_non_string_prompt_rejected passed
    Non string prompt rejected (no description in the source; shown from the name)
  • test_path_traversal_rejected passed
    Path traversal rejected (no description in the source; shown from the name)
  • test_absolute_path_rejected passed
    Absolute path rejected (no description in the source; shown from the name)
  • test_symlink_escape_rejected passed
    Symlink escape rejected (no description in the source; shown from the name)
  • test_missing_file_and_directory_rejected passed
    Missing file and directory rejected (no description in the source; shown from the name)
  • test_missing_or_non_string_path_rejected passed
    Missing or non string path rejected (no description in the source; shown from the name)
  • test_nonexistent_sandbox_root_returns_error passed
    Nonexistent sandbox root returns error (no description in the source; shown from the name)
  • test_oversize_image_rejected_before_provider passed
    Oversize image rejected before provider (no description in the source; shown from the name)
  • test_empty_file_rejected passed
    Empty file rejected (no description in the source; shown from the name)
  • test_non_image_with_image_extension_rejected passed
    Non image with image extension rejected (no description in the source; shown from the name)
  • test_type_not_supported_by_provider_rejected passed
    Type not supported by provider rejected (no description in the source; shown from the name)
  • test_http_error_becomes_tool_result passed
    Http error becomes tool result (no description in the source; shown from the name)
  • test_url_error_becomes_tool_result passed
    Url error becomes tool result (no description in the source; shown from the name)
  • test_response_shape_error_becomes_tool_result passed
    Response shape error becomes tool result (no description in the source; shown from the name)
  • test_unexpected_provider_exception_becomes_tool_result passed
    Unexpected provider exception becomes tool result (no description in the source; shown from the name)
  • test_empty_description_becomes_tool_result passed
    Empty description becomes tool result (no description in the source; shown from the name)
  • test_gemini_builds_real_request_and_parses_text passed
    Gemini builds real request and parses text (no description in the source; shown from the name)
  • test_gemini_no_text_raises_value_error passed
    Gemini no text raises value error (no description in the source; shown from the name)
  • test_gemini_requires_api_key_and_model passed
    Gemini requires api key and model (no description in the source; shown from the name)
  • test_anthropic_builds_real_request_and_parses_text passed
    Anthropic builds real request and parses text (no description in the source; shown from the name)
  • test_anthropic_no_text_raises_value_error passed
    Anthropic no text raises value error (no description in the source; shown from the name)
  • test_anthropic_requires_api_key_and_model passed
    Anthropic requires api key and model (no description in the source; shown from the name)
  • test_reference_providers_declare_supported_types passed
    Reference providers declare supported types (no description in the source; shown from the name)
  • test_make_vision_tool_schema_and_call passed
    Make vision tool schema and call (no description in the source; shown from the name)
  • test_tool_end_to_end_with_gemini_provider_mocked_network passed
    Tool end to end with gemini provider mocked network (no description in the source; shown from the name)
test_web_search.py — 15 tests 15 passed, 0 failed, 0 skipped

Tests for ragleap_tools.web_search - SearchProvider implementations, search_web(), and make_web_search_tool(). Uses a fake SearchProvider for the Tool/ToolResult wiring tests (mirrors test_search.py's FakeRagLeap approach), and mocks urllib.request.urlopen directly for the provider-specific request-building tests, so each provider's real payload/header construction is actually exercised, not bypassed.

  • test_search_web_returns_results_from_provider passed
    Search web returns results from provider (no description in the source; shown from the name)
  • test_search_web_passes_through_query_and_num_results passed
    Search web passes through query and num results (no description in the source; shown from the name)
  • test_search_web_catches_unexpected_errors passed
    Search web catches unexpected errors (no description in the source; shown from the name)
  • test_make_web_search_tool_returns_bound_tool passed
    Make web search tool returns bound tool (no description in the source; shown from the name)
  • test_make_web_search_tool_has_valid_openai_schema passed
    Make web search tool has valid openai schema (no description in the source; shown from the name)
  • test_make_web_search_tool_has_valid_gemini_schema passed
    Make web search tool has valid gemini schema (no description in the source; shown from the name)
  • test_tavily_provider_builds_correct_request passed
    Tavily provider builds correct request (no description in the source; shown from the name)
  • test_tavily_provider_handles_empty_results passed
    Tavily provider handles empty results (no description in the source; shown from the name)
  • test_serper_provider_builds_correct_request passed
    Serper provider builds correct request (no description in the source; shown from the name)
  • test_serper_provider_handles_empty_results passed
    Serper provider handles empty results (no description in the source; shown from the name)
  • test_search_web_wraps_network_error_from_real_provider passed
    Search web wraps network error from real provider (no description in the source; shown from the name)
  • test_search_web_clamps_num_results_to_maximum passed
    Search web clamps num results to maximum (no description in the source; shown from the name)
  • test_search_web_clamps_num_results_to_minimum passed
    Search web clamps num results to minimum (no description in the source; shown from the name)
  • test_search_web_coerces_numeric_string_num_results passed
    Search web coerces numeric string num results (no description in the source; shown from the name)
  • test_search_web_rejects_non_integer_num_results_without_calling_provider passed
    Search web rejects non integer num results without calling provider (no description in the source; shown from the name)

Compiled by script from the public repository, its CI logs and the GitHub API. To correct something, open an issue.

All tests