You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bitcoin_cli.py 828B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python3
  2. # Copyright (c) 2017 The Bitcoin Core developers
  3. # Distributed under the MIT software license, see the accompanying
  4. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
  5. """Test bitcoin-cli"""
  6. from test_framework.test_framework import BitcoinTestFramework
  7. from test_framework.util import assert_equal
  8. class TestBitcoinCli(BitcoinTestFramework):
  9. def set_test_params(self):
  10. self.setup_clean_chain = True
  11. self.num_nodes = 1
  12. def run_test(self):
  13. """Main test logic"""
  14. self.log.info("Compare responses from getinfo RPC and `bitcoin-cli getinfo`")
  15. cli_get_info = self.nodes[0].cli.getinfo()
  16. rpc_get_info = self.nodes[0].getinfo()
  17. assert_equal(cli_get_info, rpc_get_info)
  18. if __name__ == '__main__':
  19. TestBitcoinCli().main()