tests/testthat/test_server_getOMLStudy.R

test_that("getOMLStudy", {
  with_main_server({
    study = .getOMLStudy(99)
    study.by.alias = .getOMLStudy("OpenML-CC18")

    expect_s3_class(study, "OMLStudy")
    expect_output(print(study), "OpenML-CC18|99")

    expect_equal(study, study.by.alias)

    test_that("extractOMLStudyIds", {
    expect_set_equal(extractOMLStudyIds(study, type = "data.id"),
      study$data$data.id)
    expect_set_equal(extractOMLStudyIds(study, type = "task.id"),
      study$tasks$task.id)
    expect_set_equal(extractOMLStudyIds(study, type = "flow.id"),
      study$flows$flow.id)
    expect_set_equal(extractOMLStudyIds(study, type = "run.id"),
      study$runs$run.id)
    })
  })
})
openml/r documentation built on Oct. 21, 2022, 2:21 a.m.