pnuckowski/aioresponses

`aioresponses` reorders query params

Opened this issue · 0 comments

~/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 $