test: split equality asserts joined by and

Some tests combine multiple equality checks in one `assert`.
Split those checks into separate assertions so failures point at the exact mismatch.
This also removes mixed `==` expressions that the later cleanup should not touch.
This commit is contained in:
Lőrinc
2026-03-08 20:16:16 +00:00
parent 76a5570b36
commit 4f4516e3f6
3 changed files with 27 additions and 9 deletions

View File

@@ -723,12 +723,14 @@ class ImportDescriptorsTest(BitcoinTestFramework):
try:
self.nodes[0].cli("-rpcwallet=encrypted_wallet").walletlock()
except JSONRPCException as e:
assert e.error["code"] == -4 and "Error: the wallet is currently being used to rescan the blockchain for related transactions. Please call `abortrescan` before locking the wallet." in e.error["message"]
assert_equal(e.error["code"], -4)
assert "Error: the wallet is currently being used to rescan the blockchain for related transactions. Please call `abortrescan` before locking the wallet." in e.error["message"]
try:
self.nodes[0].cli("-rpcwallet=encrypted_wallet").walletpassphrasechange("passphrase", "newpassphrase")
except JSONRPCException as e:
assert e.error["code"] == -4 and "Error: the wallet is currently being used to rescan the blockchain for related transactions. Please call `abortrescan` before changing the passphrase." in e.error["message"]
assert_equal(e.error["code"], -4)
assert "Error: the wallet is currently being used to rescan the blockchain for related transactions. Please call `abortrescan` before changing the passphrase." in e.error["message"]
assert_equal(importing.result(), [{"success": True}])