Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
[Test] Replace rpc_wallet_tests.cpp with python RPC unit tests #8450
Conversation
|
Please elaborate why these tests are unnecessary. |
pstratem
changed the title from
Remove rpc_wallet_tests.cpp
to
[Test] Replace rpc_wallet_tests.cpp with python RPC unit tests
Aug 4, 2016
|
I've written python RPC tests to replace the tests. It's much easier to maintain those tests and leads to fewer weird hacks in the setup for the tests (which is what I'm trying to avoid by removing the existing tests). |
|
utACK on the additional RPC test, NACK on removing the unit test. I don't think its wise to remove an already exiting unit test. |
jonasschnelli
added
the
Tests
label
Aug 4, 2016
|
@jonasschnelli it's an RPC unit test though... |
|
I think we need to distinct between tests on code level (linked, boost unit test framework) and test from the outside (RPC tests). Both are useful. |
|
ACK on removing the 'unit test'. I agree both kinds of tests are useful, however. Unit tests are supposed to test basic, low-level behavior. E.g.:
The removed tests are clearly RPC (functional-level) tests disguised as unit tests. They are from the time that there wasn't a proper RPC testing framework in place yet, and are not good tests at that. |
|
@laanwj I've added tests for the addmultisigaddress RPC call |
MarcoFalke
commented on an outdated diff
Aug 6, 2016
| +from test_framework.test_framework import BitcoinTestFramework | ||
| +from test_framework.util import ( | ||
| + start_nodes, | ||
| + start_node, | ||
| + assert_equal, | ||
| + connect_nodes_bi, | ||
| +) | ||
| + | ||
| + | ||
| +class WalletAccountsTest(BitcoinTestFramework): | ||
| + | ||
| + def __init__(self): | ||
| + super().__init__() | ||
| + self.setup_clean_chain = True | ||
| + self.num_nodes = 1 | ||
| + self.node_args = [[], []] |
|
|
MarcoFalke
commented on an outdated diff
Aug 6, 2016
| + super().__init__() | ||
| + self.setup_clean_chain = True | ||
| + self.num_nodes = 1 | ||
| + self.node_args = [[], []] | ||
| + | ||
| + def setup_network(self): | ||
| + self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, self.node_args) | ||
| + self.is_network_split = False | ||
| + | ||
| + def run_test (self): | ||
| + node = self.nodes[0] | ||
| + # Check that there's no UTXO on any of the nodes | ||
| + assert_equal(len(node.listunspent()), 0) | ||
| + | ||
| + node.generate(101) | ||
| + self.sync_all() |
|
|
Can you check again. I couldn't find any new addmultisig rpc tests in the added files. |
|
Concept ACK 20207c0 |
MarcoFalke
commented on an outdated diff
Aug 6, 2016
| + from_account = accounts[i] | ||
| + to_account = accounts[(i+1)%len(accounts)] | ||
| + to_address = account_addresses[to_account] | ||
| + node.sendfrom(from_account, to_address, amount_to_send) | ||
| + | ||
| + node.generate(1) | ||
| + | ||
| + for account in accounts: | ||
| + address = node.getaccountaddress(account) | ||
| + assert(address != account_addresses[account]) | ||
| + assert_equal(node.getreceivedbyaccount(account), 2.0) | ||
| + node.move(account, "", node.getbalance(account)) | ||
| + | ||
| + node.generate(101) | ||
| + | ||
| + expected_account_balances = {"": 5200.00000000} |
|
|
pstratem
added some commits
Aug 4, 2016
|
@MarcoFalke nits picked |
pstratem commentedAug 3, 2016
No description provided.