def check_method(result, method):
    """Compare given method to method listed in the result, if any.
    """
    if method is None:
        return None
    if 'method' in result and result['method'] != method:
        return "wrong method {}".format(result['method'])
    return None