diff options
author | John Newbery <john@johnnewbery.com> | 2017-04-11 15:13:09 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2017-06-27 15:51:37 +0100 |
commit | f82c709fbe9d1e7ae646a6d3b536971b411c906d (patch) | |
tree | ad36199d4451369d40bc1ed30b5d23486cae6bf4 /test/functional/getblocktemplate_proposals.py | |
parent | 66c570a38eb21153599f0478adc5a17ca9821a52 (diff) | |
download | bitcoin-f82c709fbe9d1e7ae646a6d3b536971b411c906d.tar.xz |
[tests] clarify assertions in getblocktemplate test
Diffstat (limited to 'test/functional/getblocktemplate_proposals.py')
-rwxr-xr-x | test/functional/getblocktemplate_proposals.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/functional/getblocktemplate_proposals.py b/test/functional/getblocktemplate_proposals.py index 82a82d01f2..788e3ce259 100755 --- a/test/functional/getblocktemplate_proposals.py +++ b/test/functional/getblocktemplate_proposals.py @@ -64,8 +64,7 @@ def template_to_hex(tmpl, txlist): def assert_template(node, tmpl, txlist, expect): rsp = node.getblocktemplate({'data': template_to_hex(tmpl, txlist), 'mode': 'proposal'}) - if rsp != expect: - raise AssertionError('unexpected: %s' % (rsp,)) + assert_equal(rsp, expect) class GetBlockTemplateProposalTest(BitcoinTestFramework): @@ -88,7 +87,7 @@ class GetBlockTemplateProposalTest(BitcoinTestFramework): txlist = [bytearray(coinbase_tx.serialize())] self.log.info("getblocktemplate: Test capability advertised") - assert('proposal' in tmpl['capabilities']) + assert 'proposal' in tmpl['capabilities'] self.log.info("getblocktemplate: Test bad input hash for coinbase transaction") txlist[0][4 + 1] += 1 @@ -131,8 +130,7 @@ class GetBlockTemplateProposalTest(BitcoinTestFramework): rawtmpl = template_to_bytearray(tmpl, txlist) rawtmpl[4 + 32] = (rawtmpl[4 + 32] + 1) % 0x100 rsp = node.getblocktemplate({'data': b2x(rawtmpl), 'mode': 'proposal'}) - if rsp != 'bad-txnmrklroot': - raise AssertionError('unexpected: %s' % (rsp,)) + assert_equal(rsp, 'bad-txnmrklroot') self.log.info("getblocktemplate: Test bad timestamps") realtime = tmpl['curtime'] |