Skip to content

test(litigation): cover provider factory selection and OpenRouter config - #106

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-58d0
Draft

test(litigation): cover provider factory selection and OpenRouter config#106
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-58d0

Conversation

@cursor

@cursor cursor Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered

  • Litigation provider factory (litigation/providers/factory.py): provider selection for ollama, lm_studio, and openrouter backends; OpenRouter attribution headers and extra_body construction; missing OPENROUTER_API_KEY guard; unknown provider rejection; invalid/empty config edge cases.

Test files added/updated

  • tests/test_litigation_providers.py — new (7 tests)

Why these tests materially reduce regression risk

The provider factory is the single entry point for all litigation LLM backends. Misconfigured OpenRouter headers, missing API key handling, or wrong provider class selection would break courtroom deliberation runs silently or at runtime with opaque errors. These tests lock the wiring without requiring live API calls.

Validation

pip install -e ".[dev]" && python3 -m pytest tests/

67 passed

Open in Web View Automation 

Add regression tests for ollama/lm_studio/openrouter provider wiring,
OpenRouter attribution headers and extra_body, and missing API key guard.

Co-authored-by: exios4 <exios4@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant