Skip to content

test: cover litigation provider factory selection and OpenRouter config - #112

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

test: cover litigation provider factory selection and OpenRouter config#112
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-77d1

Conversation

@cursor

@cursor cursor Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered

  • Litigation provider factory (litigation/providers/factory.py): backend selection for ollama, lm_studio, and openrouter.
  • OpenRouter configuration: HTTP attribution headers (HTTP-Referer, X-Title), extra_body provider routing and user id, env-based OPENROUTER_API_KEY lookup, and missing-key error handling.
  • Unknown provider guard: rejects unsupported provider names.

Test files added/updated

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

Why these tests materially reduce regression risk

The litigation runner depends on get_provider to wire the correct LLM backend for courtroom deliberations. Misconfigured OpenRouter headers or missing API key handling would fail silently or at runtime in production runs. These tests pin factory behavior without requiring live API calls.

Validation

python3 -m pytest tests/66 passed

Open in Web View Automation 

Add regression tests for get_provider across ollama, lm_studio, and
openrouter backends, including attribution headers, extra_body routing,
env-based API key lookup, and missing-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