RagLeap
Tests

Tests: ragleap-tools

Test files: 12. Test functions: 129. 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 passed 133 passed, 0 skipped, 0 failed CI job

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_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_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_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