psf / psf/cachecontrol

multiple_choices vs multiple_choices_redirect

Open
#184 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
505
Forks
149
Avg merge
2d 13h
Merged PRs (30d)
7

Description

While working on #183 and wondering why some tests take a long time, I noticed a bug in TestMultipleChoicesRedirects - the test accesses /multiple_choices_redirect/ but the SimpleApp server only defines /multiple_choices/ - so in this case, it falls back to the default 200 response in __call__. This may be hiding a real bug, I didn't really investigate further.

Maybe it would be a better idea to return a 404 or 500 error in cases of unknown URLs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/test_redirects.py at TestMultipleChoicesRedirects and the SimpleApp routes and call in tests/conftest.py. Run the redirect test and verify whether /multiple_choices_redirect/ is intended to exercise a defined response rather than the default 200 fallback. Done means the test no longer silently uses the fallback and unknown URLs have the agreed error behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.