Local HTTP server sending fake files for testing purposes
I have developed a Python client/library for aria2 called aria2p.
To test my code, I spawn aria2c processes to interact with them and see if everything works correctly. I know I could mock the calls, but I feel like actually testing the interaction between my client and aria2c is a better way to ensure my code does its best.
Until recently the test suite fed actual downloads to aria2c (like Linux distributions ISOs, metalinks, magnets, or torrents), but of course the inevitable happened: some URLs broke.
So I decided to go full local. This post describes my attempt at spawning local HTTP servers to serve fake/virtual files efficiently, files that are then fed to aria2c.



