aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/test_framework/authproxy.py
Commit message (Collapse)AuthorAgeFilesLines
* authproxy: Add support for RPC named argumentsWladimir J. van der Laan2017-01-051-2/+4
|
* Merge #9077: [qa] Increase wallet-dump RPC timeoutMarcoFalke2016-11-071-1/+10
|\ | | | | | | | | e89614b [qa] Add more helpful RPC timeout message (Russell Yanofsky) 8463aaa [qa] Increase wallet-dump RPC timeout (Russell Yanofsky)
| * [qa] Add more helpful RPC timeout messageRussell Yanofsky2016-11-071-1/+10
| | | | | | | | Replace previous timeout('timed out',) exception with more detailed error.
* | [copyright] copyright header style uniformisle29832016-11-061-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | Three categories of modifications: 1) 1 instance of 'The Bitcoin Core developers \n', 1 instance of 'the Bitcoin Core developers\n', 3 instances of 'Bitcoin Core Developers\n', and 12 instances of 'The Bitcoin developers\n' are made uniform with the 443 instances of 'The Bitcoin Core developers\n' 2) 3 instances of 'BitPay, Inc\.\n' are made uniform with the other 6 instances of 'BitPay Inc\.\n' 3) 4 instances where there was no '(c)' between the 'Copyright' and the year where it deviates from the style of the local directory.
* test: Avoid ConnectionResetErrors during RPC testsWladimir J. van der Laan2016-09-291-2/+3
| | | | | | This is necessary on FreeBSD and MacOSX, at least. See https://github.com/bitcoin/bitcoin/pull/8834#issuecomment-250450213
* tests: Add exception error message for JSONRPCExceptionWladimir J. van der Laan2016-09-251-1/+5
| | | | | | | | | | | | | | | | | | | | | This improves error reporting if `JSONRPCException` is not specifically caught and ends up in Python's default backtrace handler. Before: ``` Traceback (most recent call last): File "/.../projects/bitcoin/bitcoin/qa/rpc-tests/test_framework/authproxy.py", line 153, in __call__ raise JSONRPCException(response['error']) test_framework.authproxy.JSONRPCException ``` After: ``` Traceback (most recent call last): File "/.../projects/bitcoin/bitcoin/qa/rpc-tests/test_framework/authproxy.py", line 152, in __call__ raise JSONRPCException(response['error']) test_framework.authproxy.JSONRPCException: Unknown named parameter random (-8) ```
* test: add ensure_ascii setting to AuthServiceProxyWladimir J. van der Laan2016-06-101-7/+9
| | | | | | | | | Add a setting ensure_ascii to AuthServiceProxy. This setting, defaulting to True (backwards compatible), is passed through to json.dumps. If set to False, non-ASCII characters >0x80 are not escaped. This is useful for testing server input processing, as well as slightly more bandwidth friendly in case of heavy unicode usage.
* Fix interrupted HTTP RPC connection workaround for Python 3.5+Pieter Wuille2016-06-021-0/+5
|
* tests: Check Content-Type header returned from RPC serverWladimir J. van der Laan2016-04-071-0/+5
| | | | | | | | | | | | | Check the Content-Type header that is returned from the RPC server. Only if it is `application/json` the data is supposed to be parsed as JSON. This gives better reporting if the HTTP server happens to return an error that is not JSON-formatted, which is the case if it happens at a lower level before JSON-RPC kicks in. Before: `Unexpected exception caught during testing: No JSON object could be decoded` After: `JSONRPC error: non-JSON HTTP response with '403 Forbidden' from server`
* test_framework: Py3.4 compat: Specify timeout parameter by nameLuke Dashjr2016-03-281-3/+2
| | | | | | | | Changed in version 3.4: The strict parameter was removed. HTTP 0.9-style “Simple Responses” are not longer supported. (https://docs.python.org/3/library/http.client.html) Source: https://github.com/jgarzik/python-bitcoinrpc/commit/7ebeebb4f61917fe590d980cb4f9aefdce2c8f25
* test_framework: Avoid infinite loop in encoding DecimalWladimir J. van der Laan2016-03-281-1/+1
| | | | | | | Avoid an infinite loop in encoding, by ensuring EncodeDecimal returns a string. round(Decimal) used to convert it to float, but it no longer does in python 3.x. Strings are supported since #6380, so just use that.
* Add basic coverage reporting for RPC testsJames O'Beirne2015-11-111-5/+5
| | | | Thanks to @MarcoFalke @dexX7 @laanwj for review.
* Make RPC tests cope with server-side timeout between requestsWladimir J. van der Laan2015-09-211-14/+22
| | | | | | | | | Python's httplib does not graciously handle disconnections from the http server, resulting in BadStatusLine errors. See https://bugs.python.org/issue3566 "httplib persistent connections violate MUST in RFC2616 sec 8.1.4." This was fixed in Python 3.5. Work around it for now.
* rpc-tests: remove python-bitcoinrpc directoryJonas Schnelli2015-05-211-0/+156
place authproxy.py at same level as other utility classes