Skip to content

test: expand coverage to 322 assertions + pre-release audit#5

Merged
sena-labs merged 1 commit into
mainfrom
claude/relaxed-tesla-665a6e
May 7, 2026
Merged

test: expand coverage to 322 assertions + pre-release audit#5
sena-labs merged 1 commit into
mainfrom
claude/relaxed-tesla-665a6e

Conversation

@sena-labs
Copy link
Copy Markdown
Owner

Summary

  • 60 new test assertions across 7 new sections (26–32), raising the total from 262 → 322 (all passing)
  • README.md: remove 4 obsolete screenshot placeholder comments
  • PR template: update stale test count reference (252 → 322)
  • Branch hygiene: deleted 4 stale `claude/*` branches (local + remote) that were already merged

New test sections

# Area What's covered
26 `_stream_response()` Mixed reasoning+content chunk, empty reasoning/content strings, non-dict choices[0], citations-only chunk, generic exception
27 `pipes()` Model missing `id`/`name` key, invalid pricing string (ValueError), non-JSON HTTPError body
28 `_inject_cache_control()` All-image content (no text → nothing applied), mixed image+text, user-role list
29 `_non_stream_response()` `choices=[]` + `error` field, `content=None`, missing `content` key
30 Citation helpers `[0]` zero-index unchanged, duplicate `[1]` refs both replaced, query-param URLs, duplicate URL list
31 Provider icons All 22 provider keys verified non-null; unknown → `None`; uppercase input works
32 `_retryable_request()` `stream=True`/`False` flag forwarded correctly to `requests.Session.post`

Security audit

  • No secrets in any tracked file (`.env` files are gitignored and not committed)
  • No build artifacts tracked (`pycache/`, `.pytest_cache/`, `.pyc` all gitignored)
  • Repo contains exactly 18 tracked files, all legitimate

Test plan

  • `python test_pipe.py` → `Total: 322 | ✓ Passed: 322 | ✗ Failed: 0`
  • All 7 new sections run cleanly on Python 3.10

🤖 Generated with Claude Code

- Add 60 new assertions across 7 new test sections (26-32):
  · Section 26: _stream_response() edge cases (mixed chunks, empty
    reasoning/content, non-dict choices, citations-only chunk, generic exc)
  · Section 27: pipes() additional paths (missing id/name, invalid pricing,
    non-JSON HTTPError body)
  · Section 28: _inject_cache_control() edge cases (all-image content,
    mixed image+text, user-role list)
  · Section 29: _non_stream_response() edge cases (error+empty choices,
    None content, missing content key)
  · Section 30: citation helper edge cases (zero-index ref, duplicate refs,
    query-param URLs, duplicate URL list)
  · Section 31: all 22 provider icons verified
  · Section 32: _retryable_request() stream flag verified
- README.md: remove 4 obsolete TODO screenshot placeholder comments
- .github/PULL_REQUEST_TEMPLATE.md: update test count 252 → 322

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 7, 2026 08:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands the repository’s unit test suite for openrouter_pipe.py to cover additional edge cases ahead of a pre-release audit, while also cleaning up minor documentation/template staleness.

Changes:

  • Added 7 new test sections (26–32) covering additional edge cases in streaming/non-streaming responses, model listing, cache-control injection, citation helpers, provider icons, and stream flag forwarding.
  • Removed obsolete screenshot placeholder comments from README.md.
  • Updated PR template’s referenced unit test count to match the current suite total.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
test_pipe.py Adds new assertion blocks covering additional edge cases across multiple Pipe helpers and request paths.
README.md Removes obsolete TODO screenshot placeholder comments from the feature gallery.
.github/PULL_REQUEST_TEMPLATE.md Updates the unit test count reference to 322/322.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test_pipe.py
Comment thread test_pipe.py
@sena-labs sena-labs merged commit a99832e into main May 7, 2026
8 checks passed
@sena-labs sena-labs deleted the claude/relaxed-tesla-665a6e branch May 7, 2026 10:16
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.

2 participants