def to_bazelname(filename: str, mockname: str) -> str:
    """
    maps divided mock class file name to bazel target name
    e.g. map "test/mocks/server/admin_stream.h" to "//test/mocks/server:admin_stream_mocks"

    Args:
        filename: string, mock class header file name (might be the whole path instead of the base name)
        mockname: string, mock directory name

    Returns:
        corresponding bazel target name
    """
    bazelname = "//test/mocks/{}:".format(mockname)
    bazelname += filename.split('/')[-1].replace('.h', '') + '_mocks'.format(mockname)
    return bazelname