From 635bf8ba96df1132a449e3029d1183bc904964fb Mon Sep 17 00:00:00 2001 From: "DESKTOP-RTLN3BA\\$punk" Date: Thu, 16 Apr 2026 01:32:42 -0700 Subject: [PATCH] fix: update LlamaCloud test assertions to reflect new parse modes - Changed assertions in `test_llamacloud_basic_uses_cost_effective_tier` to check for `parse_page_with_llm` instead of `cost_effective` tier. - Updated `test_llamacloud_premium_uses_agentic_plus_tier` to verify `parse_page_with_agent` instead of `agentic_plus` tier. - Ensured that `tier` is no longer included in the call arguments. --- .../unit/etl_pipeline/test_etl_pipeline_service.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/surfsense_backend/tests/unit/etl_pipeline/test_etl_pipeline_service.py b/surfsense_backend/tests/unit/etl_pipeline/test_etl_pipeline_service.py index faee49711..8571136c3 100644 --- a/surfsense_backend/tests/unit/etl_pipeline/test_etl_pipeline_service.py +++ b/surfsense_backend/tests/unit/etl_pipeline/test_etl_pipeline_service.py @@ -862,7 +862,7 @@ async def test_azure_di_premium_uses_prebuilt_layout(tmp_path, mocker): async def test_llamacloud_basic_uses_cost_effective_tier(tmp_path, mocker): - """Basic mode should use cost_effective tier for LlamaCloud.""" + """Basic mode should use parse_page_with_llm parse_mode for LlamaCloud.""" pdf_file = tmp_path / "report.pdf" pdf_file.write_bytes(b"%PDF-1.4 fake content " * 10) @@ -890,11 +890,12 @@ async def test_llamacloud_basic_uses_cost_effective_tier(tmp_path, mocker): assert result.markdown_content == "# Llama basic" call_kwargs = llama_parse_cls.call_args[1] - assert call_kwargs["tier"] == "cost_effective" + assert call_kwargs["parse_mode"] == "parse_page_with_llm" + assert "tier" not in call_kwargs async def test_llamacloud_premium_uses_agentic_plus_tier(tmp_path, mocker): - """Premium mode should use agentic_plus tier for LlamaCloud.""" + """Premium mode should use parse_page_with_agent parse_mode for LlamaCloud.""" pdf_file = tmp_path / "report.pdf" pdf_file.write_bytes(b"%PDF-1.4 fake content " * 10) @@ -922,4 +923,5 @@ async def test_llamacloud_premium_uses_agentic_plus_tier(tmp_path, mocker): assert result.markdown_content == "# Llama premium" call_kwargs = llama_parse_cls.call_args[1] - assert call_kwargs["tier"] == "agentic_plus" + assert call_kwargs["parse_mode"] == "parse_page_with_agent" + assert "tier" not in call_kwargs