Skip to content

Commit

Permalink
refined sweep tests
Browse files Browse the repository at this point in the history
  • Loading branch information
azimov committed Jan 6, 2025
1 parent 7ad2c7a commit 963f740
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions tests/testthat/test-parameterSweep.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,29 @@ testAllParams <- function(connectionDetails,
studyStartDate <- ""
studyEndDate <- ""
}
sccResult <- runSelfControlledCohort(connection = conn,
cdmDatabaseSchema = cdmDatabaseSchema,
cdmVersion = cdmVersion,
exposureIds = c(767410, 1314924, 907879),
exposureTable = exposureTable,
outcomeIds = 444382,
outcomeTable = outcomeTable,
minAge = minAge,
maxAge = maxAge,
studyStartDate = studyStartDate,
studyEndDate = studyEndDate,
addLengthOfExposureExposed = addLengthOfExposure,
addLengthOfExposureUnexposed = addLengthOfExposure,
hasFullTimeAtRisk = hasFullTimeAtRisk,
computeTarDistribution = computeTarDistribution)
expect_equal(class(sccResult), "sccResults")
expect_equal(class(summary(sccResult)), "data.frame")

resultPath <- tempfile()
dir.create(resultPath)
runSelfControlledCohort(connection = conn,
cdmDatabaseSchema = cdmDatabaseSchema,
cdmVersion = cdmVersion,
exposureIds = c(767410, 1314924, 907879),
exposureTable = exposureTable,
outcomeIds = 444382,
outcomeTable = outcomeTable,
negativeControlPairs = list(c(767410, 444382)),
controlType = "exposure",
minAge = minAge,
maxAge = maxAge,
studyStartDate = studyStartDate,
studyEndDate = studyEndDate,
addLengthOfExposureExposed = addLengthOfExposure,
addLengthOfExposureUnexposed = addLengthOfExposure,
hasFullTimeAtRisk = hasFullTimeAtRisk,
computeTarDistribution = computeTarDistribution,
resultExportPath = resultPath)

expect_file_exists(file.path(resultPath, "scc_result.csv"))
}
}
}
Expand Down

0 comments on commit 963f740

Please sign in to comment.