Skip to content

Commit

Permalink
remove fs from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ablack3 committed Dec 19, 2024
1 parent e8421df commit 94c0d08
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/testthat/test-03-db-generateCohortSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,19 @@ test_that("no error is given if attrition table already exists and overwrite = T

test_that("readCohortSet works from working directory", {
skip("manual test") # seems to work as a standalone test but fails when running testtat
skip_if_not_installed("fs")
fs::dir_copy(system.file("cohorts1", package = "CDMConnector", mustWork = TRUE),
file.path(tempdir(), "cohorts1"),
overwrite = TRUE)

source_folder <- system.file("cohorts1", package = "CDMConnector", mustWork = TRUE)
destination_folder <- file.path(tempdir(), "cohorts1")

if (!dir.exists(destination_folder)) {
dir.create(destination_folder, recursive = TRUE)
}

files <- list.files(source_folder, full.names = TRUE, recursive = TRUE)

file.copy(from = files,
to = file.path(destination_folder, basename(files)),
overwrite = TRUE)

withr::with_dir(tempdir(), {
cohortSet <- readCohortSet("cohorts1")
Expand Down

0 comments on commit 94c0d08

Please sign in to comment.