mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
test: Add test for missing and omitted required arg
This commit is contained in:
parent
635f1900d0
commit
fa96f93f05
1 changed files with 7 additions and 3 deletions
|
@ -95,15 +95,19 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
|
|||
self.check_invalid(INVALID_ADDRESS, 'Not a valid Bech32 or Base58 encoding')
|
||||
self.check_invalid(INVALID_ADDRESS_2, 'Not a valid Bech32 or Base58 encoding')
|
||||
|
||||
node = self.nodes[0]
|
||||
|
||||
# Missing arg returns the help text
|
||||
assert_raises_rpc_error(-1, "Return information about the given bitcoin address.", node.validateaddress)
|
||||
# Explicit None is not allowed for required parameters
|
||||
assert_raises_rpc_error(-3, "JSON value of type null is not of expected type string", node.validateaddress, None)
|
||||
|
||||
def test_getaddressinfo(self):
|
||||
node = self.nodes[0]
|
||||
|
||||
assert_raises_rpc_error(-5, "Invalid Bech32 address data size", node.getaddressinfo, BECH32_INVALID_SIZE)
|
||||
|
||||
assert_raises_rpc_error(-5, "Not a valid Bech32 or Base58 encoding", node.getaddressinfo, BECH32_INVALID_PREFIX)
|
||||
|
||||
assert_raises_rpc_error(-5, "Invalid prefix for Base58-encoded address", node.getaddressinfo, BASE58_INVALID_PREFIX)
|
||||
|
||||
assert_raises_rpc_error(-5, "Not a valid Bech32 or Base58 encoding", node.getaddressinfo, INVALID_ADDRESS)
|
||||
|
||||
def run_test(self):
|
||||
|
|
Loading…
Reference in a new issue