Search in sources :

Example 1 with HandoutModel

use of org.edx.mobile.model.api.HandoutModel in project edx-app-android by edx.

the class ApiTests method testHandouts.

// TODO: Debug and fix test failure
@Ignore
@Test
public void testHandouts() throws Exception {
    login();
    // get a course id for this test
    List<EnrolledCoursesResponse> courses = executeStrict(courseAPI.getEnrolledCourses());
    assertTrue("Must have enrolled to at least one course", courses != null && courses.size() > 0);
    String handoutURL = courses.get(0).getCourse().getCourse_handouts();
    HandoutModel model = executeStrict(HandoutModel.class, okHttpClient.newCall(new Request.Builder().url(handoutURL).get().build()));
    assertTrue(model != null);
    print(model.handouts_html);
}
Also used : EnrolledCoursesResponse(org.edx.mobile.model.api.EnrolledCoursesResponse) Request(okhttp3.Request) HandoutModel(org.edx.mobile.model.api.HandoutModel) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Request (okhttp3.Request)1 EnrolledCoursesResponse (org.edx.mobile.model.api.EnrolledCoursesResponse)1 HandoutModel (org.edx.mobile.model.api.HandoutModel)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1