Skip to content

test: Reach 100% test coverage - #156

Merged
datakurre merged 3 commits into
mainfrom
datakurre-coverage
Oct 16, 2026
Merged

datakurre merged 3 commits into
mainfrom
datakurre-coverage

Conversation

@datakurre

@datakurre datakurre commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator
  • Remove legacy Python 2 fallbacks in parsers, utils, and builders.
  • Modernize maybe_str, resolve_path, and auth token handling.
  • Add unit tests for edge cases across builders, directives, lexers, parsers, and utils.
  • Strengthen mock assertions and exact token checks from code review.

Assisted-by: Antigravity (Gemini 3.8 Flash)


📚 Documentation preview 📚: https://sphinxcontrib-httpexample--156.org.readthedocs.build/

@datakurre datakurre self-assigned this Oct 15, 2026
@read-the-docs-community

read-the-docs-community Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 sphinxcontrib-httpexample | 🛠️ Build #35177003 | 📁 Comparing 441db53 against latest (07788d4)

  🔍 Preview build  

1 file changed
± index.html

@coveralls-official

coveralls-official Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 100.0% (+1.6%) from 98.394% — datakurre-coverage into main

@datakurre
datakurre marked this pull request as draft October 15, 2026 12:14
- Decode non-JSON payloads to str in HTTPRequest.data(), eliminating maybe_str across builders and utils.
- Make HTTPRequest.auth() robust against malformed basic auth and preserve tokens with split(None, 1).
- Add support for JSON null (None) and literal constants in astify_json_obj.
- Preserve empty JSON objects and arrays in curl, wget, httpie, and requests builders.
- Handle missing modules, type errors, and invalid specs gracefully in utils.resolve_path.
- Add docs directory to sys.path in docs/conf.py for standalone sphinx-build and pytest runs.
- Expand test suite across builders, directives, lexers, parsers, and utils to achieve 100% coverage.

Assisted-by: Antigravity (Gemini 3.8 Flash)
@stevepiercy

Copy link
Copy Markdown
Member

@datakurre I see this marked as a draft. Is it ready for review?

@datakurre

Copy link
Copy Markdown
Collaborator Author

Not yet. I need to review it by myself first :)

I think, I found more Py2 legacy to remove, but have not pushed yet.

@datakurre
datakurre marked this pull request as ready for review October 15, 2026 19:06
@datakurre

Copy link
Copy Markdown
Collaborator Author

The review flagged my instruction to remove internal maybe_str-helper and related change of internal HTTPRequest class to always return request data already in str. Since all the requests are defined in text, the should never contain binary payload and therefore this should be ok.

I'd like to merge this and rebase the builder-args on top of this.

@datakurre

Copy link
Copy Markdown
Collaborator Author

@stevepiercy Now this is ready :)

@stevepiercy stevepiercy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A question and a possible typo. Otherwise LGTM and is a nice clean up.

Comment thread src/sphinxcontrib/httpexample/builders.py Outdated
Comment thread tests/test_builders.py Outdated
datakurre and others added 2 commits October 15, 2026 22:50
Co-authored-by: Steve Piercy <web@stevepiercy.com>
- Add HTTPRequest.has_data() so builders distinguish a missing body from
  falsy JSON bodies ({}, [], 0, false, "", null); drop unreachable inner
  "if data" checks.
- Emit JSON null as data='null' in requests (json=None sends no body).
- Escape single quotes in curl --data-raw and wget --post/--body-data.
- requests: keep blank form values, accept form content type with
  parameters, keep raw body when it has no key=value pairs.
- Split Basic auth token only on the first colon (wget, requests).
- Stop doubling newlines in multi-line bodies.
- Narrow auth() exception handling and decode bodies strictly.
- Align isort with black 26 by dropping lines_after_imports.

Assisted-by: Claude Code (claude-opus-5-5)

@stevepiercy stevepiercy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It might be good to get another pair of eyes on this before merging. I'll request other folks to take a look. Maybe give them a day, oh, Plone Tune-up Day starts now!

@stevepiercy

Copy link
Copy Markdown
Member

@sneridagh @pnicolli @Hrittik20 this PR lays the foundation for better parsing of @plone/client.

The docs look exactly the same, so I think this can be merged, if you don't want to wait.

https://sphinxcontrib-httpexample--156.org.readthedocs.build/en/156/index.html

@datakurre
datakurre merged commit 20f4961 into main Oct 16, 2026
43 checks passed
@datakurre
datakurre deleted the datakurre-coverage branch October 16, 2026 07:58
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