RequestSequence is difficult to use on Python 3
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- api, testing-qa
Research direction
The issue names RequestSequence, HasHeaders, request tuples, and response tuples; start by locating those entry points and comparing their current type handling. The scope is not singular: settle whether the change covers rejecting or coercing str and bytes, header consistency, a builder API, or some combination. Done should mean the selected behavior is specified and consistently applied.
Written by the indexing model from the issue text.
Description
RequestSequence is very picky about types of arguments, but lacks any checking or coercion. For example, in the request tuple:
b'get'vs.'get'—the former is requiredb'get'vs.'GET'—the former is required- The URL is
str, but everything else must bebytes
If you pass the wrong type, the request sequence will not ever match. I'd say we should blacklist str where bytes is required and vice-versa. (Blacklist rather than whitelist because the ability to pass fuzzy matchers like HasHeaders is useful.)
In the response tuple:
- Headers must be a dict of strings, as noted in #123, which is inconsistent with HasHeaders. HasHeaders requires lists of strings.
And generally speaking, writing out these tuples is easy to botch. Perhaps we should add a builder API to make it easier?
- Dominant language
- Python
- Stars
- 603
- Forks
- 140
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from twisted/treq
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Coveralls is broken Openbug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 42/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100