svanoort / pyresttest

Python Rest Testing
Apache License 2.0
1.15k stars 325 forks source link

Bug in 'curl_option_' parsing #138

Closed jcelliott closed 8 years ago

jcelliott commented 8 years ago

The usage of string.lstrip in tests.py is incorrect. The documentation for lstrip specify that the argument is "the set of characters to be removed" not a string prefix to be removed. The result is that if you specify, e.g., curl_option_timeout you get the following error message:

ValueError: Illegal curl option: MEOUT

after the 't' and 'i' in 'timeout' were stripped.

svanoort commented 8 years ago

Good catch, thank you @jcelliott

I've added tests to cover this, plus a fix (and credit for discovering it in the changelog) with https://github.com/svanoort/pyresttest/commit/0d3c793892422c1f5e57f9bf2f25eee4054d53d4