test: create assert_not_equal util and add to where imports are needed

In the functional tests there are lots of cases where we assert != which
this new util will replace, we also are adding the imports and the new assertion
This commit is contained in:
kevkevin authored and kevkevinpal committed 2025-04-01 08:39:24 -04:00
1 parent 930b237f16
commit 7bb83f6718
41 files changed
+137 -83

No files matched your search

+4 -3
View File
@@ -18,6 +18,7 @@ from test_framework.messages import (
)
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_not_equal,
assert_approx,
assert_equal,
assert_fee_amount,
@@ -660,7 +661,7 @@ class RawTransactionsTest(BitcoinTestFramework):
outputs = {self.nodes[0].getnewaddress():1.1}
rawtx = wallet.createrawtransaction(inputs, outputs)
fundedTx = wallet.fundrawtransaction(rawtx)
assert fundedTx["changepos"] != -1
assert_not_equal(fundedTx["changepos"], -1)
# Now we need to unlock.
with WalletUnlock(wallet, "test"):
@@ -903,10 +904,10 @@ class RawTransactionsTest(BitcoinTestFramework):
for out in res_dec['vout']:
if out['value'] > 1.0:
changeaddress += out['scriptPubKey']['address']
assert changeaddress != ""
assert_not_equal(changeaddress, "")
nextaddr = self.nodes[3].getnewaddress()
# Now the change address key should be removed from the keypool.
assert changeaddress != nextaddr
assert_not_equal(changeaddress, nextaddr)
def test_option_subtract_fee_from_outputs(self):
self.log.info("Test fundrawtxn subtractFeeFromOutputs option")