question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple response URLs not working correctly

See original GitHub issue

The fix for #161 breaks multi-URL functionality.

Test case:

def test_multiple_urls():
    @responses.activate
    def run():
        responses.add(responses.GET, 'http://example.com/one', body='one')
        responses.add(responses.GET, 'http://example.com/two', body='two')

        resp = requests.get('http://example.com/two')
        assert_response(resp, 'two')
        resp = requests.get('http://example.com/one')
        assert_response(resp, 'one')

    run()
    assert_reset()

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
beliaev-maksimcommented, Jan 10, 2022

@markstory test from the issue is present in current unit tests and passes OK, please close

image

1reaction
ngaya-llcommented, Dec 8, 2017

This is behaving as expected per https://github.com/getsentry/responses/pull/171 (see this comment).

  • Initially there is just one response registered.
  • When the first request is made, the first response is returned.
  • When the second response is created, it is appended to the list of responses.
  • When the second request is made, the first response is returned again. At this point the first response is discarded since there are multiple matches.
  • Subsequent requests will return the second response.
Read more comments on GitHub >

github_iconTop Results From Across the Web

3 Common URL Problems and How to Fix Them - SEO.com
Problem #2: Duplicate Home Page URLs · If you have to set up different versions for tracking purposes or some other reason, set...
Read more >
How to Fix The ERR_TOO_MANY_REDIRECTS Error - Kinsta
The ERR_TOO_MANY_REDIRECTS is, as the error suggests, caused by too many redirects, resulting in a redirect loop.
Read more >
What are Broken Links? And How Do You Find and Fix Them?
Reasons for broken links​​ There are various reasons that broken links can occur, for example: The website owner entered the incorrect URL (misspelled,...
Read more >
Hyperlinks not working in Outlook? How to make links open ...
The article explains why hyperlinks may not be working in Outlook and provides several solutions to fix the issue.
Read more >
URL unreachable errors - Search Console Help
See RFC 2616 for a complete list of these status codes. Likely reasons for this error are an internal server error or a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found