https://github.com/ctlab/phantasus
Raw File
Tip revision: ccd60dd2a6b9a1f1bf827ba063afa86467c3b495 authored by J Wokaty on 24 October 2023, 15:03:44 UTC
bump x.y.z version to even y prior to creation of RELEASE_3_18 branch
Tip revision: ccd60dd
testloadPreloaded.R
context("Load preloaded datasets")
library(Biobase)

test_that("loadPreloaded throws errors correctly", {
    expect_error(loadPreloaded("aa"), regexp = "Specify the directory")

    options(phantasusPreloadedDir = "falseDirectory")
    expect_error(loadPreloaded("aa"), regexp = "No such directory")

    options(phantasusPreloadedDir = system.file("testdata", package="phantasus"))
    expect_error(loadPreloaded("falseFile"), regexp = "No such dataset")
    expect_error(loadPreloaded("wrongFormatFile"), regexp = "Wrong format")
    expect_error(loadPreloaded("wrapped_wrongFormat"), regexp = "Wrong format")

    options(phantasusPreloadedDir = NULL)
})

test_that("loadPreloaded loads file with just one ExpressionSet", {
    options(phantasusPreloadedDir = system.file("testdata", package="phantasus"))
    expect_is(loadPreloaded("aa"), "json")

    options(phantasusPreloadedDir = NULL)
})
back to top