Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aioresponses reorders query params #235

Open
andmis opened this issue Mar 24, 2023 · 0 comments
Open

aioresponses reorders query params #235

andmis opened this issue Mar 24, 2023 · 0 comments

Comments

@andmis
Copy link

andmis commented Mar 24, 2023

~/tmp $ cat mwe.py
import asyncio
import aioresponses
import aiohttp

async def main():
    with aioresponses.aioresponses() as m:
        initial_url = "http://acme.com/concat?strings=foo&strings=bar&strings=baz"
        print(f"with aioresponses, initial_url: {initial_url}")
        m.post(initial_url)

        async with aiohttp.ClientSession() as session:
            async with session.post(url=initial_url) as response:
                final_url = response.url
                print(f"with aioresponses, final_url: {final_url}")

    initial_url = "http://acme.com/concat?strings=foo&strings=bar&strings=baz"
    print(f"without aioresponses, initial_url: {initial_url}")
    m.post(initial_url)

    async with aiohttp.ClientSession() as session:
        async with session.post(url=initial_url) as response:
            final_url = response.url
            print(f"without aioresponses, final_url: {final_url}")

asyncio.run(main())
~/tmp $ python mwe.py
with aioresponses, initial_url: http://acme.com/concat?strings=foo&strings=bar&strings=baz
with aioresponses, final_url: http://acme.com/concat?strings=bar&strings=baz&strings=foo
without aioresponses, initial_url: http://acme.com/concat?strings=foo&strings=bar&strings=baz
without aioresponses, final_url: http://acme.com/concat?strings=foo&strings=bar&strings=baz
~/tmp $
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

No branches or pull requests

1 participant