Skip to content

Comments

Restore doctests in mockhttp.py#318

Merged
mindflayer merged 3 commits intotypehints-and-docstringsfrom
copilot/sub-pr-317
Feb 22, 2026
Merged

Restore doctests in mockhttp.py#318
mindflayer merged 3 commits intotypehints-and-docstringsfrom
copilot/sub-pr-317

Conversation

Copy link

Copilot AI commented Feb 22, 2026

Doctests were inadvertently removed from three methods in mocket/mocks/mockhttp.py when adding type hints and docstrings. This restores them while preserving the new annotations and structured docstrings.

Restored doctests

  • Response.set_extra_headers – verifies header count and value after adding extra headers
  • Entry.can_handle – verifies query string matching behavior (partial vs. full match)
  • Entry._parse_requestline – verifies request line parsing and ValueError on invalid input
>>> Entry._parse_requestline('GET / HTTP/1.0') == ('GET', '/', '1.0')
True
>>> Entry._parse_requestline('Im not a RequestLine')
Traceback (most recent call last):
    ...
ValueError: Not a Request-Line

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 22, 2026 20:11
…d _parse_requestline

Co-authored-by: mindflayer <527325+mindflayer@users.noreply.github.com>
Co-authored-by: mindflayer <527325+mindflayer@users.noreply.github.com>
@sonarqubecloud
Copy link

Copilot AI changed the title [WIP] Add type hints and docstrings to Mocket codebase Restore doctests in mockhttp.py Feb 22, 2026
Copilot AI requested a review from mindflayer February 22, 2026 20:12
@mindflayer mindflayer marked this pull request as ready for review February 22, 2026 20:14
@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.06%. Comparing base (a9ad9f5) to head (a2029a9).
⚠️ Report is 8 commits behind head on typehints-and-docstrings.

Additional details and impacted files
@@                    Coverage Diff                    @@
##           typehints-and-docstrings     #318   +/-   ##
=========================================================
  Coverage                     99.06%   99.06%           
=========================================================
  Files                            22       22           
  Lines                          1074     1074           
=========================================================
  Hits                           1064     1064           
  Misses                           10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mindflayer mindflayer merged commit e011f27 into typehints-and-docstrings Feb 22, 2026
12 checks passed
@mindflayer mindflayer deleted the copilot/sub-pr-317 branch February 22, 2026 20: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