def test_courses(courses_keys):
    """Tests an API call to /courses/ endpoint."""

    uw_driver = UW_Driver()
    response = uw_driver.courses()

    assert isinstance(response, list)
    assert isinstance(response[0], dict)
    assert set(courses_keys).issubset(
        response[0].keys()), "All courses keys should be present."
def test_courses_by_subject_catalog(courses_keys, course_id_keys):
    """Tests an API call to /courses/{subject}/{catalog_number} endpoint.
        subject=PHYS, catalog=234"""

    uw_driver = UW_Driver()
    response = uw_driver.courses(subject="PHYS", catalog_num=234)

    assert isinstance(response, dict)
    assert set(courses_keys).issubset(response.keys())
    assert set(course_id_keys).issubset(response.keys())
def test_courses(courses_keys, subject_keys, course_id_keys):
    """Tests an API call to /courses/{course_id} endpoint.
        course_id=007407"""

    uw_driver = UW_Driver()
    response = uw_driver.courses(course_id=7407)

    assert isinstance(response, dict)
    assert set(courses_keys).issubset(response.keys())
    assert set(subject_keys).issubset(response.keys())
    assert set(course_id_keys).issubset(response.keys())
def test_courses_subjects(courses_keys, subject_keys):
    """Tests an API call to /courses/{subject} endpoint.
        subject=MATH"""

    uw_driver = UW_Driver()
    response = uw_driver.courses(subject="MATH")

    assert isinstance(response, list)
    assert isinstance(response[0], dict)
    assert set(courses_keys).issubset(
        response[0].keys()), "All courses keys should be present."
    assert set(subject_keys).issubset(
        response[0].keys()), "All subjects keys should be present."