mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-02 09:15:04 +02:00
scripted-diff: replace remaining Python test equality asserts
Some Python functional tests still use plain `assert x == y`. The earlier commits convert the ambiguous assert patterns by hand, so this commit can rewrite the remaining safe cases mechanically. The verify script excludes `wallet_bumpfee.py`, `test_framework/netutil.py`, and `test_framework/authproxy.py`, which still contain assert forms that the plain line-based substitution would misidentify. -BEGIN VERIFY SCRIPT- perl -pi -e 's/^(\s*)assert (.+?) == ([^,#]+?)$/\1assert_equal(\2, \3)/' $(git ls-files -- 'test/functional' \ ':(exclude)test/functional/wallet_bumpfee.py' ':(exclude)test/functional/test_framework/netutil.py' ':(exclude)test/functional/test_framework/authproxy.py') -END VERIFY SCRIPT-
This commit is contained in:
@@ -22,9 +22,9 @@ class DisableWalletTest (BitcoinTestFramework):
|
||||
# Make sure wallet is really disabled
|
||||
assert_raises_rpc_error(-32601, 'Method not found', self.nodes[0].getwalletinfo)
|
||||
x = self.nodes[0].validateaddress('3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy')
|
||||
assert x['isvalid'] == False
|
||||
assert_equal(x['isvalid'], False)
|
||||
x = self.nodes[0].validateaddress('mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ')
|
||||
assert x['isvalid'] == True
|
||||
assert_equal(x['isvalid'], True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user