mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-30 15:54:03 +02:00
test: prep manual equality assert conversions
The later scripted diff only handles plain `assert x == y` lines. Some remaining tests still use equality inside comprehensions, parenthesized asserts, and other shapes that the line-based rewrite would misread. Rewrite those sites by hand first so the later mechanical conversion stays safe. The commit also simplifies the dead `len(["errors"]) == 0` branch in `blocktools.py`, which can never be true.
This commit is contained in:
@@ -146,7 +146,8 @@ class TxConflicts(BitcoinTestFramework):
|
||||
|
||||
unspents = alice.listunspent()
|
||||
assert_equal(len(unspents), 3)
|
||||
assert all([tx["amount"] == 25 for tx in unspents])
|
||||
for tx in unspents:
|
||||
assert_equal(tx["amount"], 25)
|
||||
|
||||
# tx1 spends unspent[0] and unspent[1]
|
||||
raw_tx = alice.createrawtransaction(inputs=[unspents[0], unspents[1]], outputs=[{bob.getnewaddress() : 49.9999}])
|
||||
@@ -336,7 +337,8 @@ class TxConflicts(BitcoinTestFramework):
|
||||
|
||||
unspents = alice.listunspent()
|
||||
assert_equal(len(unspents), 2)
|
||||
assert all([tx["amount"] == 25 for tx in unspents])
|
||||
for tx in unspents:
|
||||
assert_equal(tx["amount"], 25)
|
||||
|
||||
assert_equal(alice.getrawmempool(), [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user