def METHOD_NAME(self, course_attr):
    """
    Test that the xblocks data is calculated correctly.
    """
    course = getattr(self, course_attr)
    blocks_data = _calculate_course_xblocks_data(course.id)
    expected_cache_data = getattr(self, course_attr + '_expected_cache_data')
    for usage_key, __ in expected_cache_data.items():
        for path_index, path in enumerate(blocks_data[str(usage_key)]['paths']):
            for path_item_index, path_item in enumerate(path):
                assert path_item['usage_key'] == expected_cache_data[usage_key][path_index][path_item_index]