Jaymon / testdata

Python module to make testing easier, it can generate random data like names and text, run commands, fetch urls, create files and directories, and more
MIT License
10 stars 0 forks source link

Augment testdata.server to have a proxy server #18

Open Jaymon opened 6 years ago

Jaymon commented 6 years ago

the idea would be you would set your development tests to use this proxy as the host, and set the proxy to the actual development host, and that it would transparently pass any requests from the proxy to the actual api

The only difference is the proxy has an api also, so you could say, on the next request I want a 405 to be returned no matter what, and then when your test client makes the request, the proxy would just return a 405, things like that.

This could actually be part of testdata to be honest, but be available on the command line also, so you could start it like this for javascript testing and stuff:

$ testdata proxy host:port
Jaymon commented 6 years ago

https://github.com/abhinavsingh/proxy.py/blob/develop/proxy.py

this one has https support: https://github.com/inaz2/proxy2

javascript proxies: https://github.com/nodejitsu/node-http-proxy https://www.npmjs.com/package/development-proxy

Jaymon commented 5 years ago

I wasn't sure how to do this but then I did a coding challenge thing and I've now got working proxy code that I think I can modify to work in this context