Test files: 32. Test functions: 300. Described by their authors (docstring or @DisplayName): 51. Where there is no description, the line shows the test name in words and says so.
Latest result: ragleap-rag-tests passed 350 passed, 18 skipped, 0 failed CI job
test_async_and_batch.py — 7 tests 7 passed, 0 failed, 0 skipped
Tests for async ingest/ask methods and ingest_batch() concurrent mixed-type ingestion with partial-success semantics.
test_aingest_text_workspassed
Aingest text works (no description in the source; shown from the name)test_aask_workspassed
Aask works (no description in the source; shown from the name)test_aask_stream_yields_piecespassed
Aask stream yields pieces (no description in the source; shown from the name)test_ingest_batch_all_succeedpassed
Ingest batch all succeed (no description in the source; shown from the name)test_ingest_batch_partial_failure_does_not_block_otherspassed
Ingest batch partial failure does not block others (no description in the source; shown from the name)test_ingest_batch_preserves_input_orderpassed
Ingest batch preserves input order (no description in the source; shown from the name)test_aask_stream_respects_rerank_and_metadata_filterpassed
Aask stream respects rerank and metadata filter (no description in the source; shown from the name)
test_cache.py — 8 tests 8 passed, 0 failed, 0 skipped
Tests for the in-memory query embedding cache — hit/miss tracking, LRU eviction, disabled-cache behavior, and integration through ask().
test_cache_miss_then_hitpassed
Cache miss then hit (no description in the source; shown from the name)test_cache_key_includes_modelpassed
Cache key includes model (no description in the source; shown from the name)test_cache_stats_tracks_hits_and_missespassed
Cache stats tracks hits and misses (no description in the source; shown from the name)test_cache_evicts_least_recently_used_when_fullpassed
Cache evicts least recently used when full (no description in the source; shown from the name)test_cache_clear_resets_everythingpassed
Cache clear resets everything (no description in the source; shown from the name)test_rag_cache_disabled_returns_zeroed_statspassed
Rag cache disabled returns zeroed stats (no description in the source; shown from the name)test_rag_ask_repeated_query_is_a_cache_hitpassed
Rag ask repeated query is a cache hit (no description in the source; shown from the name)test_rag_cache_backend_redis_requires_redis_urlpassed
Rag cache backend redis requires redis url (no description in the source; shown from the name)
test_chunker.py — 7 tests 7 passed, 0 failed, 0 skipped
Tests for TextChunker — chunk windowing/overlap, and token_count accuracy (real tiktoken counts when available, honest word-count fallback with token_count_is_exact=False when tiktoken can't load).
test_chunk_text_basic_windowingpassed
Chunk text basic windowing (no description in the source; shown from the name)test_chunk_text_empty_input_returns_empty_listpassed
Chunk text empty input returns empty list (no description in the source; shown from the name)test_chunk_text_raises_on_invalid_overlappassed
Chunk text raises on invalid overlap (no description in the source; shown from the name)test_chunk_text_reports_token_count_is_exact_flagpassed
Chunk text reports token count is exact flag (no description in the source; shown from the name)test_chunk_text_token_count_matches_tiktoken_when_exactpassed
Chunk text token count matches tiktoken when exact (no description in the source; shown from the name)test_chunk_text_fallback_word_count_when_tiktoken_unavailablepassed
Forces the fallback path regardless of the real environment, sotest_chunk_text_fallback_on_encoding_load_failurepassed
tiktoken installed but its encoding can't load (e.g. no network
test_ci_extras.py — 1 tests 1 passed, 0 failed, 0 skipped
Fails in CI (CI=true) if an optional extra the suite depends on is missing, so tests that need it cannot silently become skips. Locally these are skipped.
test_extra_is_installed_in_cipassed
Extra is installed in ci (no description in the source; shown from the name)
test_cost.py — 17 tests 17 passed, 0 failed, 0 skipped
Tests for cost tracking - per-call USD cost computation from real provider-reported token usage, and budget-triggered fallback to a cheaper/local provider on subsequent calls.
test_compute_cost_known_provider_modelpassed
Compute cost known provider model (no description in the source; shown from the name)test_compute_cost_unknown_provider_returns_nonepassed
Compute cost unknown provider returns none (no description in the source; shown from the name)test_compute_cost_unknown_model_returns_nonepassed
Compute cost unknown model returns none (no description in the source; shown from the name)test_compute_cost_no_usage_returns_nonepassed
Compute cost no usage returns none (no description in the source; shown from the name)test_compute_cost_ollama_wildcard_is_zeropassed
Compute cost ollama wildcard is zero (no description in the source; shown from the name)test_cost_tracker_pricing_table_override_winspassed
Cost tracker pricing table override wins (no description in the source; shown from the name)test_cost_tracker_override_does_not_remove_other_seed_modelspassed
Overriding one model for a provider shouldn't wipe out the othertest_cost_tracker_accumulates_across_callspassed
Cost tracker accumulates across calls (no description in the source; shown from the name)test_cost_tracker_no_budget_set_is_never_over_budgetpassed
Cost tracker no budget set is never over budget (no description in the source; shown from the name)test_cost_tracker_over_budget_after_threshold_crossedpassed
Cost tracker over budget after threshold crossed (no description in the source; shown from the name)test_ask_result_has_cost_field_with_known_pricingpassed
Ask result has cost field with known pricing (no description in the source; shown from the name)test_ask_result_cost_unavailable_for_unpriced_modelpassed
A model not in the seed pricing table - cost must honestly reporttest_ask_pricing_table_override_applies_through_rag_constructorpassed
Ask pricing table override applies through rag constructor (no description in the source; shown from the name)test_cumulative_cost_grows_across_multiple_ask_callspassed
Cumulative cost grows across multiple ask calls (no description in the source; shown from the name)test_budget_fallback_triggers_switch_to_fallback_providerpassed
First call stays on primary (nothing spent yet, so not over budget).test_no_budget_fallback_configured_never_switches_providerpassed
budget_usd_per_month set but no budget_fallback provider -> staystest_ask_stream_cost_is_always_unavailablepassed
Streaming has no token usage data (see generate_answer_stream's
test_embedding.py — 29 tests 25 passed, 0 failed, 4 skipped
Tests for embedding provider expansion (v0.7.0), updated for v0.9.0's removal of all hardcoded model/dimension defaults - every provider now requires explicit model= and dimensions= (constructor arg or env var), matching the precedent "together" always set. Split into two groups: config-resolution tests (no network calls, no keys needed beyond fakes) and real live tests against a genuinely running local Ollama instance, skipped automatically if Ollama isn't reachable so CI never fails on its absence.
test_mistral_requires_explicit_model_and_dimensionspassed
Mistral requires explicit model and dimensions (no description in the source; shown from the name)test_mistral_works_with_explicit_model_and_dimensionspassed
Mistral works with explicit model and dimensions (no description in the source; shown from the name)test_together_requires_explicit_model_and_dimensionspassed
Together requires explicit model and dimensions (no description in the source; shown from the name)test_together_works_with_explicit_model_and_dimensionspassed
Together works with explicit model and dimensions (no description in the source; shown from the name)test_cohere_requires_explicit_model_and_dimensionspassed
Cohere requires explicit model and dimensions (no description in the source; shown from the name)test_cohere_works_with_explicit_model_and_dimensionspassed
Cohere works with explicit model and dimensions (no description in the source; shown from the name)test_cohere_defaults_base_url_to_first_party_when_unsetpassed
Regression test for antonyrag/ragleap-core#360's CO1 finding:test_cohere_honors_explicit_base_urlpassed
The actual bug fix: a caller-supplied base_url must now be usedtest_voyage_requires_explicit_model_and_dimensionspassed
Voyage requires explicit model and dimensions (no description in the source; shown from the name)test_voyage_works_with_explicit_model_and_dimensionspassed
Voyage works with explicit model and dimensions (no description in the source; shown from the name)test_voyage_defaults_base_url_to_first_party_when_unsetpassed
Same regression coverage as cohere's, for V1's finding.test_voyage_honors_explicit_base_urlpassed
Voyage honors explicit base url (no description in the source; shown from the name)test_missing_api_key_raises_for_mistralpassed
Missing api key raises for mistral (no description in the source; shown from the name)test_missing_api_key_raises_for_coherepassed
Missing api key raises for cohere (no description in the source; shown from the name)test_missing_api_key_raises_for_voyagepassed
Missing api key raises for voyage (no description in the source; shown from the name)test_missing_model_raises_even_with_valid_api_keypassed
The core of the v0.9.0 change - having an API key isn't enough,test_missing_dimensions_raises_even_with_model_specifiedpassed
Missing dimensions raises even with model specified (no description in the source; shown from the name)test_ollama_needs_no_api_key_but_still_needs_model_and_dimensionspassed
Mirrors generation.py's existing ollama exemption from requiringtest_env_var_fallback_for_mistralpassed
Env var fallback for mistral (no description in the source; shown from the name)test_unknown_provider_raisespassed
Unknown provider raises (no description in the source; shown from the name)test_explicit_dimensions_always_required_no_override_conceptpassed
There's no "default to override" anymore - dimensions must alwaystest_custom_provider_requires_base_urlpassed
Custom provider requires base url (no description in the source; shown from the name)test_custom_provider_works_with_all_fields_explicitpassed
Proves the escape hatch this session was about: any OpenAI-test_custom_provider_env_var_fallbackpassed
Custom provider env var fallback (no description in the source; shown from the name)test_custom_provider_dispatches_to_openai_compatible_pathpassed
Confirms EmbeddingService actually routes provider="custom" throughtest_ollama_embed_text_returns_real_vectorskipped
Ollama embed text returns real vector (no description in the source; shown from the name)test_ollama_embed_batch_returns_real_vectorsskipped
Ollama embed batch returns real vectors (no description in the source; shown from the name)test_ollama_embed_text_empty_string_returns_noneskipped
Ollama embed text empty string returns none (no description in the source; shown from the name)test_ollama_full_rag_integration_with_faissskipped
Real end-to-end proof: Ollama embeds -> stored in a real FAISS
test_evaluation.py — 8 tests 8 passed, 0 failed, 0 skipped
Tests for rag.evaluate() - deterministic retrieval hit-rate, keyword coverage, and citation groundedness checks. Not testing real semantic quality (the fake embedder/generator have none) - testing that the scoring logic itself is correct, using real Postgres full-text search for retrieval and the fake generator's real prompt-echo behavior to create genuinely checkable keyword overlap.
test_evaluate_requires_at_least_one_casepassed
Evaluate requires at least one case (no description in the source; shown from the name)test_evaluate_retrieval_hit_rate_all_hitspassed
Evaluate retrieval hit rate all hits (no description in the source; shown from the name)test_evaluate_retrieval_hit_rate_partial_misspassed
Evaluate retrieval hit rate partial miss (no description in the source; shown from the name)test_evaluate_keyword_coverage_uses_real_answer_contentpassed
The fake generator echoes the prompt's tail, which includes thetest_evaluate_keyword_coverage_partialpassed
Evaluate keyword coverage partial (no description in the source; shown from the name)test_evaluate_groundedness_when_keyword_in_cited_chunkpassed
Ingest text containing 'bananas' so it ends up in the citedtest_evaluate_returns_none_for_metrics_with_no_applicable_casespassed
Evaluate returns none for metrics with no applicable cases (no description in the source; shown from the name)test_evaluate_passes_through_ask_kwargspassed
Evaluate passes through ask kwargs (no description in the source; shown from the name)
test_faiss_backend.py — 10 tests 10 passed, 0 failed, 0 skipped
Real tests for FAISSBackend - genuine FAISS index + SQLite sidecar, no mocking of the backend itself. Skipped automatically if the [faiss] extra isn't installed, so it never blocks CI runs without it.
test_faiss_ingest_and_ask_roundtrippassed
Faiss ingest and ask roundtrip (no description in the source; shown from the name)test_faiss_dense_search_finds_correct_documentpassed
Dense-only search with a non-semantic fake embedder can onlytest_faiss_backend_does_not_support_sparsepassed
Faiss backend does not support sparse (no description in the source; shown from the name)test_faiss_hybrid_mode_gracefully_degrades_to_densepassed
hybrid=True should not crash against a backend with no sparsetest_faiss_list_documentspassed
Faiss list documents (no description in the source; shown from the name)test_faiss_delete_document_removes_itpassed
Faiss delete document removes it (no description in the source; shown from the name)test_faiss_delete_unknown_document_returns_falsepassed
Faiss delete unknown document returns false (no description in the source; shown from the name)test_faiss_metadata_filter_post_filters_correctlypassed
Faiss metadata filter post filters correctly (no description in the source; shown from the name)test_faiss_update_document_preserves_filenamepassed
Faiss update document preserves filename (no description in the source; shown from the name)test_faiss_persistence_across_backend_instancespassed
The real point of persist_directory= - data survives a fresh
test_guardrails.py — 8 tests 8 passed, 0 failed, 0 skipped
Tests for input_guardrails/output_guardrails - user-supplied validation callbacks that extend (not replace) sanitization and injection-risk detection.
test_input_guardrail_can_modify_textpassed
Input guardrail can modify text (no description in the source; shown from the name)test_input_guardrail_violation_aborts_ingestion_with_nothing_storedpassed
Input guardrail violation aborts ingestion with nothing stored (no description in the source; shown from the name)test_input_guardrails_run_in_orderpassed
Input guardrails run in order (no description in the source; shown from the name)test_ask_output_guardrail_passes_through_when_no_violationpassed
Ask output guardrail passes through when no violation (no description in the source; shown from the name)test_ask_output_guardrail_blocks_and_replaces_answerpassed
Ask output guardrail blocks and replaces answer (no description in the source; shown from the name)test_ask_without_output_guardrails_has_no_blocked_keypassed
Ask without output guardrails has no blocked key (no description in the source; shown from the name)test_ask_stream_guardrail_violation_logs_warning_but_still_yieldspassed
Ask stream guardrail violation logs warning but still yields (no description in the source; shown from the name)test_ask_stream_output_guardrail_passes_through_when_no_violationpassed
Ask stream output guardrail passes through when no violation (no description in the source; shown from the name)
test_ingestion.py — 9 tests 9 passed, 0 failed, 0 skipped
Tests for RagLeap.ingest_text() — chunking, storage, sanitization, injection-risk warnings, and error handling.
test_ingest_text_returns_document_id_and_chunk_countpassed
Ingest text returns document id and chunk count (no description in the source; shown from the name)test_ingest_text_empty_raises_value_errorpassed
Ingest text empty raises value error (no description in the source; shown from the name)test_ingest_text_whitespace_only_raisespassed
Ingest text whitespace only raises (no description in the source; shown from the name)test_ingest_text_sanitizes_control_chars_by_defaultpassed
Ingest text sanitizes control chars by default (no description in the source; shown from the name)test_ingest_text_sanitize_false_preserves_raw_textpassed
Ingest text sanitize false preserves raw text (no description in the source; shown from the name)test_ingest_text_logs_warning_on_injection_riskpassed
Ingest text logs warning on injection risk (no description in the source; shown from the name)test_ingest_text_stores_metadatapassed
Ingest text stores metadata (no description in the source; shown from the name)test_ingest_stores_metadatapassed
Regression test for the real gap ingest() had: it silentlytest_ingest_without_metadata_still_workspassed
Confirms the default (no metadata=) path is unchanged - the
test_lifecycle.py — 10 tests 10 passed, 0 failed, 0 skipped
Tests for document lifecycle: list_documents, delete_document, update_document — including the known metadata-loss limitation.
test_list_documents_returns_ingested_docspassed
List documents returns ingested docs (no description in the source; shown from the name)test_list_documents_includes_chunk_countpassed
List documents includes chunk count (no description in the source; shown from the name)test_list_documents_ordered_most_recent_firstpassed
List documents ordered most recent first (no description in the source; shown from the name)test_delete_document_removes_it_and_returns_truepassed
Delete document removes it and returns true (no description in the source; shown from the name)test_delete_document_unknown_id_returns_falsepassed
Delete document unknown id returns false (no description in the source; shown from the name)test_delete_document_cascades_to_chunkspassed
Delete document cascades to chunks (no description in the source; shown from the name)test_update_document_creates_new_document_idpassed
Update document creates new document id (no description in the source; shown from the name)test_update_document_preserves_filename_if_not_givenpassed
Update document preserves filename if not given (no description in the source; shown from the name)test_update_document_renames_when_filename_givenpassed
Update document renames when filename given (no description in the source; shown from the name)test_update_document_known_limitation_metadata_is_lostpassed
Documents a REAL, currently-open limitation (see README/Part 5
test_memory.py — 7 tests 7 passed, 0 failed, 0 skipped
Tests for persistent conversation memory (session-scoped, Postgres-backed).
test_get_history_empty_for_new_sessionpassed
Get history empty for new session (no description in the source; shown from the name)test_ask_with_session_id_stores_historypassed
Ask with session id stores history (no description in the source; shown from the name)test_ask_without_session_id_stores_nothingpassed
Ask without session id stores nothing (no description in the source; shown from the name)test_multiple_turns_accumulate_in_orderpassed
Multiple turns accumulate in order (no description in the source; shown from the name)test_sessions_are_isolatedpassed
Sessions are isolated (no description in the source; shown from the name)test_clear_session_removes_all_messagespassed
Clear session removes all messages (no description in the source; shown from the name)test_history_injected_into_prompt_via_generatorpassed
The fake generator echoes the tail of the prompt it received -
test_metadata_filtering.py — 4 tests 4 passed, 0 failed, 0 skipped
Tests for metadata_filter on ask() — JSONB containment filtering, the multi-tenant isolation mechanism.
test_metadata_filter_restricts_results_to_matching_tenantpassed
Metadata filter restricts results to matching tenant (no description in the source; shown from the name)test_metadata_filter_hybrid_mode_also_respects_filterpassed
Metadata filter hybrid mode also respects filter (no description in the source; shown from the name)test_no_metadata_filter_returns_from_any_tenantpassed
No metadata filter returns from any tenant (no description in the source; shown from the name)test_metadata_filter_no_match_returns_empty_sourcespassed
Metadata filter no match returns empty sources (no description in the source; shown from the name)
test_milvus_backend.py — 16 tests 16 passed, 0 failed, 0 skipped
Tests for MilvusBackend - NOT live-verified against a real Milvus/ Zilliz Cloud instance (same honest caveat as the other new vector backends this session). Mocks the actual pymilvus MilvusClient entirely; every method signature used was verified against the actual installed pymilvus==3.0.1 package's real source during development (including that id_type="string" is a genuinely supported primary key type, not assumed from documentation alone).
test_requires_persist_directorypassed
Requires persist directory (no description in the source; shown from the name)test_requires_uripassed
Requires uri (no description in the source; shown from the name)test_uri_from_env_varpassed
Uri from env var (no description in the source; shown from the name)test_vector_key_constructionpassed
Vector key construction (no description in the source; shown from the name)test_build_filter_expr_single_conditionpassed
Build filter expr single condition (no description in the source; shown from the name)test_build_filter_expr_multiple_conditions_andedpassed
Build filter expr multiple conditions anded (no description in the source; shown from the name)test_build_filter_expr_numeric_value_not_quotedpassed
Build filter expr numeric value not quoted (no description in the source; shown from the name)test_build_filter_expr_empty_when_no_filterpassed
Build filter expr empty when no filter (no description in the source; shown from the name)test_insert_document_and_list_documentspassed
Insert document and list documents (no description in the source; shown from the name)test_insert_chunk_calls_insert_with_correct_rowpassed
Insert chunk calls insert with correct row (no description in the source; shown from the name)test_search_dense_returns_chunks_with_text_from_sqlitepassed
Search dense returns chunks with text from sqlite (no description in the source; shown from the name)test_search_dense_normalizes_cosine_similarity_to_unit_rangepassed
Regression test for the similarity_score normalization fix. Milvustest_search_dense_skips_orphaned_hitspassed
Search dense skips orphaned hits (no description in the source; shown from the name)test_delete_document_calls_delete_with_vector_keyspassed
Delete document calls delete with vector keys (no description in the source; shown from the name)test_supports_sparse_is_falsepassed
Supports sparse is false (no description in the source; shown from the name)test_milvus_backend_importable_from_vectorstorespassed
Milvus backend importable from vectorstores (no description in the source; shown from the name)
test_net_guard.py — 15 tests 18 passed, 0 failed, 0 skipped
Attack-case tests for ragleap._net, ragleap.web and ingest_url(). A loopback HTTP server stands in for the network; `pretend_public` makes names ending in .test resolve to it while still passing the public-address check, so redirect re-validation and IP pinning are exercised for real.
test_non_public_targets_are_refusedpassed
Non public targets are refused (no description in the source; shown from the name)test_odd_address_forms_are_refused_or_unresolvablepassed
Odd address forms are refused or unresolvable (no description in the source; shown from the name)test_bad_schemes_credentials_and_missing_host_are_refusedpassed
Bad schemes credentials and missing host are refused (no description in the source; shown from the name)test_allow_private_fetches_loopbackpassed
Allow private fetches loopback (no description in the source; shown from the name)test_connects_to_validated_ip_and_sends_original_hostpassed
Connects to validated ip and sends original host (no description in the source; shown from the name)test_redirect_to_private_address_is_refusedpassed
Redirect to private address is refused (no description in the source; shown from the name)test_redirect_loop_returns_nonepassed
Redirect loop returns none (no description in the source; shown from the name)test_oversized_body_returns_nonepassed
Oversized body returns none (no description in the source; shown from the name)test_non_200_and_encoded_responses_return_nonepassed
Non 200 and encoded responses return none (no description in the source; shown from the name)test_slow_server_hits_the_timeoutpassed
Slow server hits the timeout (no description in the source; shown from the name)test_fetch_url_text_refuses_loopback_by_defaultpassed
Fetch url text refuses loopback by default (no description in the source; shown from the name)test_fetch_url_text_extracts_when_private_is_allowedpassed
Fetch url text extracts when private is allowed (no description in the source; shown from the name)test_ingest_url_refuses_loopback_by_defaultpassed
Ingest url refuses loopback by default (no description in the source; shown from the name)test_compressed_responses_are_decodedpassed
Compressed responses are decoded (no description in the source; shown from the name)test_decompression_bomb_returns_nonepassed
Decompression bomb returns none (no description in the source; shown from the name)
test_observability.py — 7 tests 7 passed, 0 failed, 0 skipped
Tests for on_ingest/on_query/on_answer observability hooks - fire- and-forget event emission that never breaks the actual RAG operation, even when a hook raises.
test_on_ingest_fires_with_correct_event_shapepassed
On ingest fires with correct event shape (no description in the source; shown from the name)test_on_query_and_on_answer_fire_on_askpassed
On query and on answer fire on ask (no description in the source; shown from the name)test_on_query_and_on_answer_fire_on_ask_streampassed
On query and on answer fire on ask stream (no description in the source; shown from the name)test_multiple_handlers_all_fire_in_orderpassed
Multiple handlers all fire in order (no description in the source; shown from the name)test_broken_hook_does_not_break_ingestionpassed
Broken hook does not break ingestion (no description in the source; shown from the name)test_broken_hook_does_not_break_askpassed
Broken hook does not break ask (no description in the source; shown from the name)test_no_hooks_configured_is_a_true_no_oppassed
No hooks set (the default) - fire_event should be a silent
test_package_metadata.py — 1 tests 1 passed, 0 failed, 0 skipped
No file-level description in the source.
test_version_matches_pyprojectpassed
Version matches pyproject (no description in the source; shown from the name)
test_parser_limits.py — 5 tests 5 passed, 0 failed, 0 skipped
No file-level description in the source.
test_zip_within_limits_still_extractspassed
Zip within limits still extracts (no description in the source; shown from the name)test_too_many_members_is_rejectedpassed
Too many members is rejected (no description in the source; shown from the name)test_declared_size_over_limit_is_rejectedpassed
Declared size over limit is rejected (no description in the source; shown from the name)test_container_formats_are_checked_toopassed
Container formats are checked too (no description in the source; shown from the name)test_running_budget_applies_even_if_the_precheck_is_bypassedpassed
Running budget applies even if the precheck is bypassed (no description in the source; shown from the name)
test_parsers.py — 5 tests 5 passed, 0 failed, 0 skipped
Per-extension extraction tests for ragleap.parsers.extract_text().
test_every_supported_extension_has_a_samplepassed
Every supported extension has a sample (no description in the source; shown from the name)test_extracts_marker_from_minimal_samplepassed
Extracts marker from minimal sample (no description in the source; shown from the name)test_legacy_office_formats_are_rejected_with_a_conversion_hintpassed
Legacy office formats are rejected with a conversion hint (no description in the source; shown from the name)test_unknown_extension_is_rejectedpassed
Unknown extension is rejected (no description in the source; shown from the name)test_parquet_without_pandas_raises_value_errorpassed
Parquet without pandas raises value error (no description in the source; shown from the name)
test_pinecone_backend.py — 20 tests 20 passed, 0 failed, 0 skipped
Tests for PineconeBackend - NOT live-verified against a real Pinecone account (same honest caveat as mistral/together/cohere/voyage embedding providers). These tests mock the actual Pinecone client entirely and verify: (1) constructor validation, (2) pure helper functions, (3) the SQLite sidecar's CRUD correctness in isolation, and (4) that the right Pinecone SDK methods get called with the right arguments and the right attribute-access pattern (not dict-style) - every attribute path used here (IndexList.names, IndexStatus.ready, ScoredVector.id/.score) was verified against the actual installed pinecone==9.1.0 package's real source code during development, not assumed from documentation alone.
test_requires_persist_directorypassed
Requires persist directory (no description in the source; shown from the name)test_requires_api_keypassed
Requires api key (no description in the source; shown from the name)test_api_key_from_env_varpassed
Api key from env var (no description in the source; shown from the name)test_default_index_name_and_regionpassed
Default index name and region (no description in the source; shown from the name)test_creates_sqlite_tables_on_initpassed
Creates sqlite tables on init (no description in the source; shown from the name)test_vector_id_constructionpassed
Vector id construction (no description in the source; shown from the name)test_build_filter_none_when_no_filterpassed
Build filter none when no filter (no description in the source; shown from the name)test_build_filter_translates_to_pinecone_eq_syntaxpassed
Build filter translates to pinecone eq syntax (no description in the source; shown from the name)test_insert_document_and_list_documentspassed
Insert document and list documents (no description in the source; shown from the name)test_get_document_filenamepassed
Get document filename (no description in the source; shown from the name)test_init_schema_creates_index_when_not_existingpassed
Init schema creates index when not existing (no description in the source; shown from the name)test_init_schema_skips_create_when_index_existspassed
Init schema skips create when index exists (no description in the source; shown from the name)test_insert_chunk_upserts_to_pinecone_with_correct_id_and_metadatapassed
Insert chunk upserts to pinecone with correct id and metadata (no description in the source; shown from the name)test_search_dense_returns_chunks_with_text_from_sqlitepassed
Search dense returns chunks with text from sqlite (no description in the source; shown from the name)test_search_dense_skips_orphaned_vectorspassed
A vector exists in Pinecone (per the mocked response) but has notest_search_dense_wrong_dimensions_returns_emptypassed
Search dense wrong dimensions returns empty (no description in the source; shown from the name)test_delete_document_deletes_from_pinecone_and_sqlitepassed
Delete document deletes from pinecone and sqlite (no description in the source; shown from the name)test_delete_document_returns_false_when_not_foundpassed
Delete document returns false when not found (no description in the source; shown from the name)test_supports_sparse_is_falsepassed
Supports sparse is false (no description in the source; shown from the name)test_pinecone_backend_importable_from_vectorstorespassed
Confirms it's actually wired into vectorstores/__init__.py, not
test_qdrant_backend.py — 15 tests 15 passed, 0 failed, 0 skipped
Tests for QdrantBackend - NOT live-verified against a real Qdrant instance (same honest caveat as PineconeBackend/WeaviateBackend). Mocks the actual Qdrant client entirely; every method signature and pydantic model field used was verified against the actual installed qdrant-client==1.18.0 package's real source during development.
test_requires_persist_directorypassed
Requires persist directory (no description in the source; shown from the name)test_requires_urlpassed
Requires url (no description in the source; shown from the name)test_url_from_env_varpassed
Url from env var (no description in the source; shown from the name)test_vector_key_constructionpassed
Vector key construction (no description in the source; shown from the name)test_deterministic_uuid_is_stablepassed
Deterministic uuid is stable (no description in the source; shown from the name)test_build_filter_translates_correctlypassed
Build filter translates correctly (no description in the source; shown from the name)test_build_filter_none_when_emptypassed
Build filter none when empty (no description in the source; shown from the name)test_insert_document_and_list_documentspassed
Insert document and list documents (no description in the source; shown from the name)test_insert_chunk_calls_upsert_with_correct_pointpassed
Insert chunk calls upsert with correct point (no description in the source; shown from the name)test_search_dense_returns_chunks_with_text_from_sqlitepassed
Search dense returns chunks with text from sqlite (no description in the source; shown from the name)test_search_dense_skips_orphaned_pointspassed
Search dense skips orphaned points (no description in the source; shown from the name)test_delete_document_calls_delete_with_point_idspassed
Delete document calls delete with point ids (no description in the source; shown from the name)test_search_dense_normalizes_cosine_similarity_to_unit_rangepassed
Regression test for the similarity_score normalization fix. Qdranttest_supports_sparse_is_falsepassed
Supports sparse is false (no description in the source; shown from the name)test_qdrant_backend_importable_from_vectorstorespassed
Qdrant backend importable from vectorstores (no description in the source; shown from the name)
test_qdrant_backend_live.py — 6 tests 0 passed, 0 failed, 6 skipped
Live tests for QdrantBackend against a real running Qdrant instance. Gated on QDRANT_TEST_URL (e.g. "http://localhost:6333"), same pattern as the OpenSearch/Upstash live-gated tests in ragleap-vectorstores - skip cleanly (not fail) when no real instance is configured.
test_init_schema_is_idempotentskipped
Init schema is idempotent (no description in the source; shown from the name)test_search_dense_orders_and_normalizes_scoreskipped
Search dense orders and normalizes score (no description in the source; shown from the name)test_search_dense_metadata_filterskipped
Search dense metadata filter (no description in the source; shown from the name)test_list_documents_and_get_filenameskipped
List documents and get filename (no description in the source; shown from the name)test_delete_document_removes_vectorsskipped
Delete document removes vectors (no description in the source; shown from the name)test_supports_sparse_is_falseskipped
Supports sparse is false (no description in the source; shown from the name)
test_query_rewrite.py — 19 tests 19 passed, 0 failed, 0 skipped
Tests for query rewriting/expansion (contextual, hyde, multi_query). Live semantic verification (real Gemini calls proving contextual rewrite correctly resolves pronouns, HyDE generates on-topic passages, multi_query produces genuinely distinct phrasings) was done manually this session and is documented in CHANGELOG - not automated into CI since it needs a real, currently-valid API key CI doesn't have.
test_contextual_rewrite_no_history_returns_original_query_no_callpassed
Contextual rewrite no history returns original query no call (no description in the source; shown from the name)test_contextual_rewrite_with_history_calls_generator_and_returns_rewritepassed
Contextual rewrite with history calls generator and returns rewrite (no description in the source; shown from the name)test_contextual_rewrite_fails_open_on_generator_errorpassed
Contextual rewrite fails open on generator error (no description in the source; shown from the name)test_contextual_rewrite_empty_answer_falls_back_to_originalpassed
Contextual rewrite empty answer falls back to original (no description in the source; shown from the name)test_hyde_document_returns_hypothetical_passagepassed
Hyde document returns hypothetical passage (no description in the source; shown from the name)test_hyde_document_fails_open_on_generator_errorpassed
Hyde document fails open on generator error (no description in the source; shown from the name)test_multi_query_variants_includes_original_firstpassed
Multi query variants includes original first (no description in the source; shown from the name)test_multi_query_variants_deduplicates_case_insensitivelypassed
Multi query variants deduplicates case insensitively (no description in the source; shown from the name)test_multi_query_variants_fails_open_to_original_onlypassed
Multi query variants fails open to original only (no description in the source; shown from the name)test_rrf_ranks_items_in_multiple_lists_higherpassed
Rrf ranks items in multiple lists higher (no description in the source; shown from the name)test_rrf_deduplicates_by_chunk_idpassed
Rrf deduplicates by chunk id (no description in the source; shown from the name)test_rrf_falls_back_to_document_id_chunk_index_when_no_chunk_idpassed
Rrf falls back to document id chunk index when no chunk id (no description in the source; shown from the name)test_rrf_empty_lists_returns_emptypassed
Rrf empty lists returns empty (no description in the source; shown from the name)test_ask_without_query_rewrite_has_no_query_rewrite_keypassed
Ask without query rewrite has no query rewrite key (no description in the source; shown from the name)test_ask_with_contextual_rewrite_needs_session_id_to_do_anythingpassed
No session_id means no history means contextual_rewrite makes notest_ask_with_hyde_returns_hyde_document_fieldpassed
Ask with hyde returns hyde document field (no description in the source; shown from the name)test_ask_with_multi_query_returns_variants_and_retrievespassed
Ask with multi query returns variants and retrieves (no description in the source; shown from the name)test_ask_final_answer_always_uses_original_query_not_rewrittenpassed
The rewrite only affects what gets retrieved, never what's showntest_ask_query_rewrite_cost_contributes_to_cumulative_spendpassed
The extra rewrite LLM call should be recorded into cumulative
test_reranking.py — 4 tests 3 passed, 0 failed, 1 skipped
No file-level description in the source.
test_rerank_true_calls_reranker_and_reorderspassed
Rerank true calls reranker and reorders (no description in the source; shown from the name)test_rerank_false_never_calls_rerankerpassed
Rerank false never calls reranker (no description in the source; shown from the name)test_rerank_expands_candidate_pool_before_rerankingpassed
rerank=True should retrieve top_k*4 candidates for the rerankertest_reranking_real_onnx_model_ranks_correctlyskipped
Real end-to-end test of the actual ONNX reranker (no mocking) -
test_retrieval.py — 14 tests 13 passed, 0 failed, 1 skipped
No file-level description in the source.
test_sparse_search_finds_real_keyword_matchespassed
Sparse search finds real keyword matches (no description in the source; shown from the name)test_sparse_search_no_match_returns_emptypassed
Sparse search no match returns empty (no description in the source; shown from the name)test_sparse_search_respects_metadata_filterpassed
Sparse search respects metadata filter (no description in the source; shown from the name)test_dense_search_respects_embedding_dimension_mismatchpassed
A query embedding of the wrong dimension should be rejected ortest_dense_search_empty_embedding_returns_emptypassed
Dense search empty embedding returns empty (no description in the source; shown from the name)test_hybrid_search_prefers_keyword_match_via_sparse_signalpassed
Dense (fake) embeddings carry no real semantic signal, so atest_hybrid_search_combines_dense_and_sparse_result_setspassed
Hybrid search combines dense and sparse result sets (no description in the source; shown from the name)test_backend_reports_sparse_supportpassed
PgVectorBackend (the default) genuinely supports sparse search -test_retrieve_returns_chunks_without_generating_answerpassed
retrieve() must never call generation - verify by making thetest_retrieve_respects_top_kpassed
Retrieve respects top k (no description in the source; shown from the name)test_retrieve_respects_metadata_filterpassed
Retrieve respects metadata filter (no description in the source; shown from the name)test_retrieve_dense_only_when_hybrid_falsepassed
Retrieve dense only when hybrid false (no description in the source; shown from the name)test_retrieve_no_documents_returns_emptypassed
Note: NOT testing "no semantic match" with an ingested document -test_retrieve_with_rerank_does_not_crashskipped
rerank=True lazily constructs a RerankerService - just verify
test_sanitization.py — 10 tests 10 passed, 0 failed, 0 skipped
Pure unit tests for sanitization — no DB needed, but autouse fixtures still run (harmless, DB is up regardless).
test_sanitize_removes_null_bytespassed
Sanitize removes null bytes (no description in the source; shown from the name)test_sanitize_removes_control_chars_but_keeps_newline_and_tabpassed
Sanitize removes control chars but keeps newline and tab (no description in the source; shown from the name)test_sanitize_empty_stringpassed
Sanitize empty string (no description in the source; shown from the name)test_sanitize_normal_text_unaffectedpassed
Sanitize normal text unaffected (no description in the source; shown from the name)test_detect_injection_risk_finds_known_patternpassed
Detect injection risk finds known pattern (no description in the source; shown from the name)test_detect_injection_risk_case_insensitivepassed
Detect injection risk case insensitive (no description in the source; shown from the name)test_detect_injection_risk_no_match_on_clean_textpassed
Detect injection risk no match on clean text (no description in the source; shown from the name)test_detect_injection_risk_empty_textpassed
Detect injection risk empty text (no description in the source; shown from the name)test_check_length_within_limitpassed
Check length within limit (no description in the source; shown from the name)test_check_length_exceeds_limitpassed
Check length exceeds limit (no description in the source; shown from the name)
test_smoke.py — 2 tests 2 passed, 0 failed, 0 skipped
Minimal smoke test — proves the fixtures, fake providers, and real Postgres schema all work together before building out the full suite.
test_ingest_and_ask_roundtrippassed
Ingest and ask roundtrip (no description in the source; shown from the name)test_schema_actually_has_pgvector_and_halfvecpassed
Schema actually has pgvector and halfvec (no description in the source; shown from the name)
test_streaming.py — 6 tests 6 passed, 0 failed, 0 skipped
Tests for ask_stream() — sync generator, incremental piece yielding, and history storage once streaming completes.
test_ask_stream_yields_and_assembles_full_answerpassed
Ask stream yields and assembles full answer (no description in the source; shown from the name)test_ask_stream_stores_full_answer_to_history_when_session_id_givenpassed
Ask stream stores full answer to history when session id given (no description in the source; shown from the name)test_ask_stream_no_session_id_stores_nothingpassed
Ask stream no session id stores nothing (no description in the source; shown from the name)test_ask_stream_respects_metadata_filterpassed
Ask stream respects metadata filter (no description in the source; shown from the name)test_ask_stream_rerank_true_calls_rerankerpassed
Ask stream rerank true calls reranker (no description in the source; shown from the name)test_ask_stream_rerank_false_never_calls_rerankerpassed
Ask stream rerank false never calls reranker (no description in the source; shown from the name)
test_structured.py — 11 tests 11 passed, 0 failed, 0 skipped
Tests for structured/JSON output mode (v0.8.0). Split into two groups: unit tests for ragleap.structured's parse/validate logic (including a forced no-jsonschema fallback path via monkeypatching, since jsonschema IS installed in this test environment), and plumbing tests proving response_format= flows correctly through ask() -> generate_answer() -> the provider call and back, using the existing fake_call_provider fixture (no live network calls - live Gemini/ Anthropic verification was done manually this session, documented in CHANGELOG, since it needs a real committed API key CI doesn't have).
test_parse_and_validate_valid_json_matching_schemapassed
Parse and validate valid json matching schema (no description in the source; shown from the name)test_parse_and_validate_valid_json_not_matching_schemapassed
Missing the required 'name' field - valid JSON, invalid per schema.test_parse_and_validate_malformed_json_returns_nonepassed
Parse and validate malformed json returns none (no description in the source; shown from the name)test_parse_and_validate_object_validpassed
Mirrors Anthropic's tool-use path, which hands back an already-test_parse_and_validate_without_jsonschema_installedpassed
Forces the basic-type-check-only fallback path by monkeypatchingtest_parse_and_validate_invalid_schema_itselfpassed
A malformed schema (invalid 'type' value) should be caught as atest_ask_without_response_format_has_no_structured_fieldspassed
Backward compatibility - existing callers who never passtest_ask_with_response_format_returns_structured_fieldspassed
Uses a permissive schema matching fake_call_provider's cannedtest_ask_with_response_format_catches_real_schema_mismatchpassed
SCHEMA requires a "name" field that the fake fixture's cannedtest_ask_with_response_format_array_schemapassed
Confirms the fake fixture (and real plumbing) respects thetest_ask_with_response_format_and_guardrails_still_workpassed
response_format's JSON-string answer still passes through the
test_weaviate_backend.py — 12 tests 12 passed, 0 failed, 0 skipped
Tests for WeaviateBackend - NOT live-verified against a real Weaviate instance (same honest caveat as PineconeBackend). Mocks the actual Weaviate client entirely; every attribute path verified against the actual installed weaviate-client==4.22.0 package's real source during development (self.collections/self.data/self.query are real instance attributes set in __init__, not class-level methods - confirmed by reading the actual source, not assumed).
test_requires_persist_directorypassed
Requires persist directory (no description in the source; shown from the name)test_collection_name_normalized_to_uppercase_first_letterpassed
Collection name normalized to uppercase first letter (no description in the source; shown from the name)test_vector_key_constructionpassed
Vector key construction (no description in the source; shown from the name)test_deterministic_uuid_is_stablepassed
Deterministic uuid is stable (no description in the source; shown from the name)test_insert_document_and_list_documentspassed
Insert document and list documents (no description in the source; shown from the name)test_insert_chunk_calls_data_insert_with_correct_argspassed
Insert chunk calls data insert with correct args (no description in the source; shown from the name)test_search_dense_converts_distance_to_similarity_scorepassed
Search dense converts distance to similarity score (no description in the source; shown from the name)test_search_dense_skips_orphaned_objectspassed
Search dense skips orphaned objects (no description in the source; shown from the name)test_delete_document_calls_delete_by_id_for_each_chunkpassed
Delete document calls delete by id for each chunk (no description in the source; shown from the name)test_search_dense_normalizes_cosine_distance_to_unit_rangepassed
Regression test for the similarity_score normalization fix.test_supports_sparse_is_falsepassed
Supports sparse is false (no description in the source; shown from the name)test_weaviate_backend_importable_from_vectorstorespassed
Weaviate backend importable from vectorstores (no description in the source; shown from the name)
test_weaviate_backend_live.py — 6 tests 0 passed, 0 failed, 6 skipped
Live tests for WeaviateBackend against a real running Weaviate instance. Gated on WEAVIATE_TEST_URL (e.g. "http://localhost:8081") and WEAVIATE_TEST_GRPC_PORT (defaults to 50051), same pattern as the OpenSearch/Upstash/Qdrant live-gated tests - skip cleanly (not fail) when no real instance is configured.
test_init_schema_is_idempotentskipped
Init schema is idempotent (no description in the source; shown from the name)test_search_dense_orders_and_normalizes_scoreskipped
Search dense orders and normalizes score (no description in the source; shown from the name)test_search_dense_metadata_filterskipped
Search dense metadata filter (no description in the source; shown from the name)test_list_documents_and_get_filenameskipped
List documents and get filename (no description in the source; shown from the name)test_delete_document_removes_vectorsskipped
Delete document removes vectors (no description in the source; shown from the name)test_supports_sparse_is_falseskipped
Supports sparse is false (no description in the source; shown from the name)
test_web_import_error.py — 1 tests 1 passed, 0 failed, 0 skipped
No file-level description in the source.
test_import_error_message_includes_the_real_causepassed
Import error message includes the real cause (no description in the source; shown from the name)