Closed thebino closed 8 years ago
Hi @thebino ,
PyRestTest offers an option to pass in custom Curl options to the tests (if there's something special which the framework does not support): https://github.com/svanoort/pyresttest#custom-http-options-special-curl-settings
In this case what you want is 'curl_option_useragent' with the new user agent. I hope that helps? PS: there's a whole list of custom options for Curl that you can use - to get the PyRestTest option name, replace 'curlopt_' with 'curloption'.
If you get too fancy though, do please note that PyRestTest does not do validation on these, beyond checking that they are valid option names with PyCurl, so it is possible to get runtime errors in the tests if you specify the wrong argument type or an invalid value.
Kind regards, Sam
brilliant, works for me as intended. Thanks for the fast response.
I've a case, where the api result depends on the user-agent so I try to override it for some test cases but it is ignored completly: