Skip to content

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

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

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

Conversation

@cursor

@cursor cursor Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered

  • Provider factory (tests/test_litigation_providers.py): ollama, lm_studio, and openrouter provider creation.
  • OpenRouter configuration: API key from argument or OPENROUTER_API_KEY env, attribution headers (HTTP-Referer, X-Title), and extra_body (provider prefs, user id).
  • Failure modes: missing OpenRouter API key and unknown provider name.

Test files added/updated

  • tests/test_litigation_providers.py (new)

Why these tests materially reduce regression risk

litigation/providers/factory.py is the single entry point for all courtroom LLM backends. Misconfigured OpenRouter headers or missing key checks would break litigation runs silently or at runtime. These tests pin provider selection and config wiring without network calls.

Validation

python3 -m pytest tests/

66 passed.

Open in Web View Automation 

Add tests for ollama/lm_studio/openrouter provider creation, env-based
API key resolution, attribution headers, extra_body, and unknown provider 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