def test_address(node, address, **kwargs):
    'Get address info for `address` and test whether the returned values are as expected.'
    addr_info = node.getaddressinfo(address)
    for (key, value) in kwargs.items():
        if (value is None):
            if (key in addr_info.keys()):
                raise AssertionError('key {} unexpectedly returned in getaddressinfo.'.format(key))
        elif (addr_info[key] != value):
            raise AssertionError('key {} value {} did not match expected value {}'.format(key, addr_info[key], value))
Get address info for `address` and test whether the returned values are as expected.
def test_address(node, address, **kwargs):
    
    addr_info = node.getaddressinfo(address)
    for (key, value) in kwargs.items():
        if (value is None):
            if (key in addr_info.keys()):
                raise AssertionError('key {} unexpectedly returned in getaddressinfo.'.format(key))
        elif (addr_info[key] != value):
            raise AssertionError('key {} value {} did not match expected value {}'.format(key, addr_info[key], value))