src/canvas-extractor/tests/data_generation/courses.py
def generate_and_load_courses(account: Account, record_count: int) -> List[Course]:
    """
    Generate and load a number of courses into the Canvas API.

    Parameters
    ----------
    canvas : Canvas
        A Canvas SDK object
    record_count : int
        The number of courses to generate.

    Returns
    -------
    List[Course]
        A list of Canvas SDK Course objects representing the created courses
    """
    assert record_count > 0, "Number of courses to generate must be greater than zero"

    courses: List[Dict] = generate_courses(record_count)

    result: List[Course] = []
    try:
        section_result = load_courses(account, courses)
        result.extend(section_result)
    except Exception as ex:
        logger.exception(ex)

    return result

    Generate and load a number of courses into the Canvas API.

    Parameters
    ----------
    canvas : Canvas
        A Canvas SDK object
    record_count : int
        The number of courses to generate.

    Returns
    -------
    List[Course]
        A list of Canvas SDK Course objects representing the created courses
    
Generate and load a number of courses into the Canvas API.
Parameters

canvas : Canvas
A Canvas SDK object
record_count : int
The number of courses to generate.

Returns

List[Course]
A list of Canvas SDK Course objects representing the created courses
Generate and load a number of courses into the Canvas API . Parameters canvas : Canvas A Canvas SDK object record_count : int The number of courses to generate . Returns List [ Course ] A list of Canvas SDK Course objects representing the created courses
def generate_and_load_courses(account: Account, record_count: int) -> List[Course]:
    assert record_count > 0, "Number of courses to generate must be greater than zero"
    courses: List[Dict] = generate_courses(record_count)
    result: List[Course] = []
    try:
        section_result = load_courses(account, courses)
        result.extend(section_result)
    except Exception as ex:
        logger.exception(ex)
    return result
def generate_and_load_courses ( account : Account , record_count : int ) -> List [ Course ] : assert record_count > 0 , "Number of courses to generate must be greater than zero" courses : List [ Dict ] = generate_courses ( record_count ) result : List [ Course ] = [ ] try : section_result = load_courses ( account , courses ) result . extend ( section_result ) except Exception as ex : logger . exception ( ex ) return result
Generate and load a number of courses into the Canvas API.
Generate and load a number of courses into the Canvas API .
"""
    Generate and load a number of courses into the Canvas API.

    Parameters
    ----------
    canvas : Canvas
        A Canvas SDK object
    record_count : int
        The number of courses to generate.

    Returns
    -------
    List[Course]
        A list of Canvas SDK Course objects representing the created courses
    """
account
Account
record_count
int