def append_to_path(uri, path):
    """
    This is a helper function for appending a path to a URI (i.e, just the path portion
    of a full URL).  The main purpose is to make sure one and only one slash ends up between them.

    :param uri: the URI to append the path to.
    :param path: the path to append.
    :return: the result of the append.
    """
    if uri.endswith('/') and path.startswith('/'):
        uri += path[1:]
    elif not (uri.endswith('/') or path.startswith('/')):
        uri = uri + '/' + path
    else:
        uri += path
    return uri
