def METHOD_NAME(
    self,
    pyramid_request,
    grouping_service,
    assignment_service,
    course_service,
    lti_h_service,
):
    returned_ids = sync(pyramid_request)
    course_service.get_by_context_id.assert_called_once_with(
        sentinel.context_id, raise_on_missing=True
    )
    course = course_service.get_by_context_id.return_value
    grouping_service.get_sections.assert_called_once_with(
        user=pyramid_request.user,
        lti_user=pyramid_request.lti_user,
        course=course_service.get_by_context_id.return_value,
        grading_student_id=sentinel.grading_student_id,
    )
    lti_h_service.sync.assert_called_once_with(
        grouping_service.get_sections.return_value, sentinel.group_info
    )
    assignment_service.get_assignment.assert_called_once_with(
        course.application_instance.tool_consumer_instance_guid,
        sentinel.resource_link_id,
    )
    assignment_service.upsert_assignment_groupings(
        assignment_service.get_assignment.return_value,
        groupings=grouping_service.get_groups.return_value,
    )
    assert returned_ids == [
        group.groupid(TEST_SETTINGS["h_authority"])
        for group in grouping_service.get_sections.return_value
    ]