-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* decommented tests * fix cran check failed cause usage cpu * fix failed test coverage ---------
- Loading branch information
1 parent
4c02ee7
commit 2f801e6
Showing
9 changed files
with
2,153 additions
and
2,149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
library(testthat) | ||
library(antaresViz) | ||
|
||
# CRAN limite CPU usage | ||
# issue : | ||
data.table::setDTthreads(2) | ||
|
||
test_check("antaresViz") |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
# context(".compOpts") | ||
# | ||
# | ||
# test_that(".compOpts", { | ||
# | ||
# expect_true(.compOpts("", "cp")$ncharts == 2) | ||
# expect_true(.compOpts("", NULL)$ncharts == 1) | ||
# expect_true(.compOpts(list(), NULL)$ncharts == 1) | ||
# }) | ||
# | ||
# if(.requireRhdf5_Antares(stopP = FALSE)){ | ||
# context(".dateRangeJoin") | ||
# test_that(".dateRangeJoin", { | ||
# dt <- list() | ||
# dt$x <- list(list(dateRange = as.Date(c("2010-01-01", "2010-01-10"))), | ||
# list(dateRange = as.Date(c("2010-01-02", "2010-01-09")))) | ||
# | ||
# | ||
# | ||
# | ||
# expect_true(.dateRangeJoin(dt, "union", "min") == as.Date("2010-01-01")) | ||
# expect_true(.dateRangeJoin(dt, "union", "max") == as.Date("2010-01-10")) | ||
# expect_true(.dateRangeJoin(dt, "intersect", "max") == as.Date("2010-01-09")) | ||
# expect_true(.dateRangeJoin(dt, "intersect", "min") == as.Date("2010-01-02")) | ||
# | ||
# dt2 <- list() | ||
# dt2$x <- list(list(ar = list(dateRange = as.Date(c("2010-01-01", "2010-01-10")))), | ||
# list(ar = list(dateRange = as.Date(c("2010-01-02", "2010-01-09"))))) | ||
# | ||
# expect_true(.dateRangeJoin(dt2, "union", "min", "ar") == as.Date("2010-01-01")) | ||
# expect_true(.dateRangeJoin(dt2, "union", "max", "ar") == as.Date("2010-01-10")) | ||
# expect_true(.dateRangeJoin(dt2, "intersect", "max", "ar") == as.Date("2010-01-09")) | ||
# expect_true(.dateRangeJoin(dt2, "intersect", "min", "ar") == as.Date("2010-01-02")) | ||
# | ||
# }) | ||
# | ||
# context(".loadH5Data") | ||
# test_that(".loadH5Data", { | ||
# opts <- setSimulationPath(studyPath) | ||
# sharerequest <- list() | ||
# sharerequest$mcYearh_l <- "all" | ||
# sharerequest$tables_l <- c("areas", "links", "clusters", "districts") | ||
# sharerequest$timeSteph5_l <- "hourly" | ||
# expect_true("antaresDataList" %in% class(.loadH5Data(sharerequest, opts))) | ||
# | ||
# }) | ||
# } | ||
context(".compOpts") | ||
|
||
|
||
test_that(".compOpts", { | ||
|
||
expect_true(.compOpts("", "cp")$ncharts == 2) | ||
expect_true(.compOpts("", NULL)$ncharts == 1) | ||
expect_true(.compOpts(list(), NULL)$ncharts == 1) | ||
}) | ||
|
||
if(.requireRhdf5_Antares(stopP = FALSE)){ | ||
context(".dateRangeJoin") | ||
test_that(".dateRangeJoin", { | ||
dt <- list() | ||
dt$x <- list(list(dateRange = as.Date(c("2010-01-01", "2010-01-10"))), | ||
list(dateRange = as.Date(c("2010-01-02", "2010-01-09")))) | ||
|
||
|
||
|
||
|
||
expect_true(.dateRangeJoin(dt, "union", "min") == as.Date("2010-01-01")) | ||
expect_true(.dateRangeJoin(dt, "union", "max") == as.Date("2010-01-10")) | ||
expect_true(.dateRangeJoin(dt, "intersect", "max") == as.Date("2010-01-09")) | ||
expect_true(.dateRangeJoin(dt, "intersect", "min") == as.Date("2010-01-02")) | ||
|
||
dt2 <- list() | ||
dt2$x <- list(list(ar = list(dateRange = as.Date(c("2010-01-01", "2010-01-10")))), | ||
list(ar = list(dateRange = as.Date(c("2010-01-02", "2010-01-09"))))) | ||
|
||
expect_true(.dateRangeJoin(dt2, "union", "min", "ar") == as.Date("2010-01-01")) | ||
expect_true(.dateRangeJoin(dt2, "union", "max", "ar") == as.Date("2010-01-10")) | ||
expect_true(.dateRangeJoin(dt2, "intersect", "max", "ar") == as.Date("2010-01-09")) | ||
expect_true(.dateRangeJoin(dt2, "intersect", "min", "ar") == as.Date("2010-01-02")) | ||
|
||
}) | ||
|
||
context(".loadH5Data") | ||
test_that(".loadH5Data", { | ||
opts <- setSimulationPath(studyPath) | ||
sharerequest <- list() | ||
sharerequest$mcYearh_l <- "all" | ||
sharerequest$tables_l <- c("areas", "links", "clusters", "districts") | ||
sharerequest$timeSteph5_l <- "hourly" | ||
expect_true("antaresDataList" %in% class(.loadH5Data(sharerequest, opts))) | ||
|
||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# context("plotThermalGroupCapacities") | ||
# | ||
# test_that("plotThermalGroupCapacities", { | ||
# opts <- setSimulationPath(studyPath) | ||
# GG <- plotThermalGroupCapacities( data = thermalGroupCapacities(opts)) | ||
# | ||
# expect_true("htmlwidget" %in% class(GG)) | ||
# | ||
# }) | ||
# | ||
context("plotThermalGroupCapacities") | ||
|
||
test_that("plotThermalGroupCapacities", { | ||
opts <- setSimulationPath(studyPath) | ||
GG <- plotThermalGroupCapacities( data = thermalGroupCapacities(opts)) | ||
|
||
expect_true("htmlwidget" %in% class(GG)) | ||
|
||
}) | ||
|
Oops, something went wrong.