inst/testing/PyFunction.R

#' # pyImport
require(testthat)
require(PythonEmbedInR)
invisible(capture.output(pyConnect()))

expect_that(pyExec("import os"), equals(0))
fun <- pyFunction("os.getcwd")
expect_that(class(fun), equals("pyFunction"))
expect_that(fun(), equals(getwd()))
Sage-Bionetworks/PythonEmbedInR documentation built on April 17, 2023, 4:23 p.m.