Package: adaptest
Adaptest - a lightweight YAML wrapper for httest================================================## OverviewThere are many powerful tools for automated HTTP-based tests, and and even in Python:- [httest](http://htt.sourceforge.net/), HTTP Test tool- [pyresttest](https://github.com/svanoort/pyresttest), Python REST Test tool- [gabbi](https://github.com/cdent/gabbi), Declarative HTTP Testing toolBut key features for me were:- powerful- easily maintenable config, ideally using YAML or something similar- Cookies support- CSRF supportSome of them were HTTP REST and JSON specific. `httest` was best option but notvery confortable .htt files especially for Testers with little knowledge of HTTPprotocol and programming.Therefore I wrote `Adaptest` which is basically a `httest` YAML wrapper.## FeaturesAs `httest` is really powerful tool, `Adaptest` does not support everything at this stage. Buteven while in alpha stage it supports:- Sequence HTTP testing- Cookies support- CSRF support- Any request headers- Multiple `expect`'s, status, response header tests, body tests- Capturing response headers or body using regex to variables and use in later testes- POST (application/x-www-form-urlencoded)- Auto referer from previous test## Examples`Adaptest` turns yaml config of test:```yml---config:auto_cookie: ontests:- name: user profile without authurl: /en/account/method: getheaders:- Connection: keep-aliveexpect:- scope: .value: "302 Found"- scope: headersvalue: "Location: /en/account/log-in/"- name: login page to get cookieurl: /en/account/log-in/method: getexpect:- scope: .value: 200 OKmatch:- scope: headerspattern: "csrftoken=([^;]+)"variable: csrf- name: login pageurl: /en/account/log-in/method: postreferer: autoheaders:- Content-Type: application/x-www-form-urlencodeddata:- csrfmiddlewaretoken: $csrf- username: eduard@adaptiware.com- password: Mys3cr3tp455expect:- scope: .value: "302 Found"- name: user profile after authurl: /en/account/method: getheaders:- Connection: keep-aliveexpect:- scope: .value: 200 OK```into this:```CLIENT_AUTO_COOKIE on_REQ example.com SSL:443_DEBUG user profile without auth__GET /en/account/ HTTP/1.1__Host: example.com__Cookie: AUTO__Connection: keep-alive___EXPECT . "302 Found"_EXPECT headers "Location: /en/account/log-in/"_WAIT_CLOSE_REQ example.com SSL:443_DEBUG login page to get cookie__GET /en/account/log-in/ HTTP/1.1__Host: example.com__Cookie: AUTO___EXPECT . "200 OK"_MATCH headers "csrftoken=([^;]+)" csrf_WAIT_CLOSE_REQ example.com SSL:443_DEBUG login page__POST /en/account/log-in/ HTTP/1.1__Host: example.com__Cookie: AUTO__Content-Length: AUTO__Content-Type: application/x-www-form-urlencoded__Referer: https://example.com/en/account/log-in/____csrfmiddlewaretoken=$csrf&username=eduard@adaptiware.com&password=Mys3cr3tp455&_EXPECT . "302 Found"_WAIT_CLOSE_REQ example.com SSL:443_DEBUG user profile after auth__GET /en/account/ HTTP/1.1__Host: example.com__Cookie: AUTO__Connection: keep-alive___EXPECT . "200 OK"_WAIT_CLOSEEND```## Installation### From source```bashgit clone git@github.com:Edke/adaptest.gitcd adaptestsudo python setup.py install```### From PyPI```bashpip install adaptest```## Testing```bashcd testspytest```## StatusPlease consider this tool as early alpha, not ready for production. Testing is more than welcome.## ContributingFor bugs, feature requests or code contributing please use [Github project page](https://github.com/Edke/adaptest).