dogecoin/test/functional/test_framework
Ben Woosley 82fc4017b7
test: Catch decimal.InvalidOperation from TestNodeCLI#send_cli
decimal.InvalidOperation is a special case of a float parsing error, which
presumably should be handled in the same way as a general parsing error,
rather than blow up.

Alternatives include: logging the error, or re-raising with more information.

Example log output:
    File "/home/travis/build/bitcoin/bitcoin/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 603, in sync_all
      self.sync_blocks(nodes)
    File "/home/travis/build/bitcoin/bitcoin/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 568, in sync_blocks
      best_hash = [x.getbestblockhash() for x in rpc_connections]
    File "/home/travis/build/bitcoin/bitcoin/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 568, in <listcomp>
      best_hash = [x.getbestblockhash() for x in rpc_connections]
    File "/home/travis/build/bitcoin/bitcoin/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_node.py", line 571, in __call__
      return self.cli.send_cli(self.command, *args, **kwargs)
    File "/home/travis/build/bitcoin/bitcoin/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_node.py", line 639, in send_cli
      return json.loads(cli_stdout, parse_float=decimal.Decimal)
    File "/usr/lib64/python3.6/json/__init__.py", line 367, in loads
      return cls(**kw).decode(s)
    File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "/usr/lib64/python3.6/json/decoder.py", line 355, in raw_decode
      obj, end = self.scan_once(s, idx)
  decimal.InvalidOperation: [<class 'decimal.InvalidOperation'>]
2020-07-30 18:45:53 -07:00
..
__init__.py
address.py Revert "[TESTS] Move base58 to own module to break circular dependency" 2020-06-10 11:54:25 -04:00
authproxy.py test: retry when write to a socket fails on macOS 2020-06-25 17:26:20 +07:00
blocktools.py [test] CScriptNum Decode Check as Unit Tests 2020-06-03 07:18:01 -07:00
coverage.py
descriptors.py Output a descriptor in createmultisig and addmultisigaddress 2020-01-30 23:55:36 -05:00
key.py [tests] move generate_wif_key to wallet_util.py 2020-06-10 12:10:02 -04:00
messages.py test: Update test framework p2p protocol version to 70016 2020-07-19 02:10:42 -04:00
mininode.py Clean message_count and last_message 2020-07-27 07:55:49 -04:00
netutil.py
script.py Merge #19082: test: Moved the CScriptNum asserts into the unit test in script.py 2020-06-04 17:28:55 +02:00
script_util.py test: Remove unused, undocumented and misleading CScript.__add__ 2020-04-22 09:00:56 -04:00
segwit_addr.py
siphash.py
socks5.py
test_framework.py test: fix intermittent p2p_ibd_txrelay race, add test_framework.py#wait_until 2020-07-19 13:37:54 +02:00
test_node.py test: Catch decimal.InvalidOperation from TestNodeCLI#send_cli 2020-07-30 18:45:53 -07:00
test_shell.py TestShell: Return self from setup() 2019-11-05 12:55:52 +01:00
util.py Merge #19208: test: move sync_blocks and sync_mempool functions to test_framework.py 2020-06-21 09:17:39 -04:00
wallet_util.py [tests] move generate_wif_key to wallet_util.py 2020-06-10 12:10:02 -04:00