Skip to content

Commit

Permalink
More unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
csoneson committed Oct 6, 2024
1 parent 86808b7 commit eabf317
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/testthat/test-plotVolcano.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,40 @@ test_that("set selection for plotting works", {
method = "missing"),
"Unknown similarity method")

expect_error(getComplexesToPlot(
featureCollections = 1, complexCandidates = c("mouse: Arnt-Ahrr complex"),
maxNbrComplexesToPlot = 10, maxComplexSimilarity = 1),
"'featureCollections' must be of class 'CharacterList'")
expect_error(getComplexesToPlot(
featureCollections = fcoll_mq_final, complexCandidates = c("mouse: Arnt-Ahrr complex"),
maxNbrComplexesToPlot = 10, maxComplexSimilarity = 1),
"'featureCollections' must be of class 'CharacterList'")
expect_error(getComplexesToPlot(
featureCollections = fcoll_mq_final$complexes,
complexCandidates = 1,
maxNbrComplexesToPlot = 10, maxComplexSimilarity = 1),
"'complexCandidates' must be of class 'character'")
expect_error(getComplexesToPlot(
featureCollections = fcoll_mq_final$complexes,
complexCandidates = c("mouse: Arnt-Ahrr complex"),
maxNbrComplexesToPlot = "10", maxComplexSimilarity = 1),
"'maxNbrComplexesToPlot' must be of class 'numeric'")
expect_error(getComplexesToPlot(
featureCollections = fcoll_mq_final$complexes,
complexCandidates = c("mouse: Arnt-Ahrr complex"),
maxNbrComplexesToPlot = c(10, 2), maxComplexSimilarity = 1),
"'maxNbrComplexesToPlot' must have length 1")
expect_error(getComplexesToPlot(
featureCollections = fcoll_mq_final$complexes,
complexCandidates = c("mouse: Arnt-Ahrr complex"),
maxNbrComplexesToPlot = 10, maxComplexSimilarity = "1"),
"'maxComplexSimilarity' must be of class 'numeric'")
expect_error(getComplexesToPlot(
featureCollections = fcoll_mq_final$complexes,
complexCandidates = c("mouse: Arnt-Ahrr complex"),
maxNbrComplexesToPlot = 10, maxComplexSimilarity = c(1, 2)),
"'maxComplexSimilarity' must have length 1")

expect_equal(getComplexesToPlot(featureCollections = fcoll_mq_final$complexes,
complexCandidates = c("mouse: Arnt-Ahrr complex",
"mouse: Arnt-Sim1 complex",
Expand Down

0 comments on commit eabf317

Please sign in to comment.