forked from PecanProject/pecan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0254085
commit e50e009
Showing
4 changed files
with
41 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test_that("`do_conversions` ", { | ||
|
||
}) |
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 |
---|---|---|
|
@@ -64,6 +64,7 @@ Suggests: | |
foreach, | ||
furrr, | ||
future, | ||
mockery, | ||
parallel, | ||
PEcAn.settings, | ||
progress, | ||
|
34 changes: 34 additions & 0 deletions
34
modules/data.atmosphere/tests/testthat/test.download.raw.met.module.R
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
test_that("`.download.raw.met.module` throws an error if register$site is unknown", { | ||
register <- list(scale = 'example') | ||
expect_error( | ||
.download.raw.met.module(dir = NULL, met = NULL, register = register, str_ns = NULL), | ||
"Unknown register\\$scale" | ||
) | ||
}) | ||
|
||
test_that("`.download.raw.met.module` is able to call the right download function based on met value", { | ||
mocked_res <- mockery::mock(10) | ||
mockery::stub(.download.raw.met.module, 'PEcAn.DB::convert_input', mocked_res) | ||
register <- list(scale = 'site') | ||
res <- .download.raw.met.module( | ||
dir = NULL, | ||
met = 'ERA5', | ||
register = register, | ||
machine = NULL, | ||
start_date = '2010-01-01', | ||
end_date = '2010-01-01', | ||
str_ns = NULL, | ||
con = NULL, | ||
input_met = NULL, | ||
site.id = 1, | ||
lat.in = 1, | ||
lon.in = 1, | ||
host = NULL, | ||
site = NULL, | ||
username = NULL, | ||
dbparms = NULL) | ||
args <- mockery::mock_args(mocked_res) | ||
mockery::expect_called(mocked_res, 1) | ||
expect_equal(res, 10) | ||
expect_equal(args[[1]]$fcn, 'download.ERA5') | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test_that("`met.process` ", { | ||
|
||
}) |