コード例 #1
0
def test_expected_subjectable_resources_work(requests_mock):
    mock_assignments(requests_mock)
    mock_summary(requests_mock)
    mock_subjects(requests_mock)
    mock_reviews(requests_mock)
    mock_single_subject(requests_mock)
    mock_study_materials(requests_mock)
    mock_summary(requests_mock)

    client = Client("arbitrary_api_key")

    assignments = client.assignments()
    assert assignments[0].subject is not None

    study_materials = client.study_materials()
    assert study_materials[0].subject is not None

    study_materials = client.study_materials()
    assert study_materials[0].subject is not None

    summary = client.summary()
    assert summary.reviews[0].subjects is not None

    reviews = client.reviews()
    assert reviews[0].subject is not None
コード例 #2
0
def test_client_can_get_study_materials(requests_mock):
    mock_study_materials(requests_mock)
    client = Client("v2_api_key")

    study_materials = client.study_materials()
    assert len(study_materials.current_page.data) > 0
コード例 #3
0
def test_real_connection_to_study_materials():
    client = Client(api_key)
    study_materials = client.study_materials()
    assert len(study_materials.current_page.data) > 0