Skip to content

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

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

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

Conversation

@cursor

@cursor cursor Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered

  • Provider factory (test_litigation_providers.py): ollama, lm_studio, and openrouter provider selection; OpenRouter attribution headers and extra_body; missing OPENROUTER_API_KEY error; unknown provider rejection; invalid/empty config edge cases.

Test files added/updated

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

Why these tests reduce regression risk

litigation/providers/factory.py is the single entry point for all litigation LLM backends. Misconfigured OpenRouter headers or provider selection would break courtroom deliberation runs silently or at runtime. These tests validate factory wiring without 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 creation,
OpenRouter attribution headers and extra_body, and missing API key errors.

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