[tests] Add getmininginfo test#11150
[tests] Add getmininginfo test#11150maflcko merged 1 commit intobitcoin:masterfrom mess110:test_rpc_getmininginfo
Conversation
test/functional/rpc_getmininginfo.py
Outdated
test/functional/rpc_getmininginfo.py
Outdated
test/functional/rpc_getmininginfo.py
Outdated
test/functional/rpc_getmininginfo.py
Outdated
test/functional/rpc_getmininginfo.py
Outdated
test/functional/rpc_getmininginfo.py
Outdated
test/functional/rpc_getmininginfo.py
Outdated
There was a problem hiding this comment.
Don't create self.mining_info, pass to functions below?
test/functional/rpc_getmininginfo.py
Outdated
There was a problem hiding this comment.
There are few with _ prefix, remove?
test/functional/rpc_getmininginfo.py
Outdated
test/functional/rpc_getmininginfo.py
Outdated
|
@promag thanks for taking a look. Obviously won't leave 2 new lines in the future 😄 |
jnewbery
left a comment
There was a problem hiding this comment.
Thanks for this @mess110 . As an alternative to making this an individual test case (which adds a few seconds overhead to running the test suite), you could add this as a sub-test at the top of the mining.py test script.
Whether or not to add a new test script or extend an old one is a judgement call. In this case, I think the getmininginfo RPC can be run at the start of mining.py without any side-effects so it's a good candidate for extending the existing test.
test/functional/rpc_getmininginfo.py
Outdated
There was a problem hiding this comment.
supernit: place imports in PEP-8 ordering (std library first, then project imports)
test/functional/rpc_getmininginfo.py
Outdated
There was a problem hiding this comment.
The This is a pre-release test build - use at your own risk error is only presented on non-release branches, so this assert will fail on all release branches. Just omit it.
test/functional/rpc_getmininginfo.py
Outdated
There was a problem hiding this comment.
No need to assert for keys in our tests. Python has you covered by throwing a KeyError in case you access a key that does not exist.
|
@jnewbery thanks. I initially started in @MarcoFalke thanks for the review and hint |
|
Looks good to me. We could test the actual values returned by Tested ACK 4f2905b |
| import copy | ||
| from binascii import b2a_hex | ||
| from decimal import Decimal | ||
|
|
4f2905b Add getmininginfo functional test (Cristian Mircea Messel) Pull request description: Add `getmininginfo` functional test in `mining.py` Tree-SHA512: 12be9cfb37e9ac4c6625fc06051704c8a8dfd7271c2654f994c7659c8810e4b7a4335105ae159315308bcd45b65589bab1829bd134d2f4cabf74d63f2e5d22fe
Github-Pull: bitcoin#11150 Rebased-From: 4f2905b
4f2905b Add getmininginfo functional test (Cristian Mircea Messel) Pull request description: Add `getmininginfo` functional test in `mining.py` Tree-SHA512: 12be9cfb37e9ac4c6625fc06051704c8a8dfd7271c2654f994c7659c8810e4b7a4335105ae159315308bcd45b65589bab1829bd134d2f4cabf74d63f2e5d22fe
Add
getmininginfofunctional test inmining.py