Skip to content

Commit

Permalink
tested met_inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
meetagrawal09 committed Aug 27, 2023
1 parent d5641b4 commit a5612f9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions base/db/tests/testthat/test.met_inputs.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test_that("`met_inputs()` able to correctly place input parameters in the database query to retrieve available met inputs", {
mocked_res <- mockery::mock(0)
mockery::stub(met_inputs, 'db.query', mocked_res)
met_inputs(dbcon = NULL, site_id = 100, model_id = 200, hostname = "pecan")
args <- mockery::mock_args(mocked_res)

expect_true(
grepl("inputs.site_id = \\$1.*machines.hostname = \\$2.*models.id = \\$3", args[[1]][[1]])
)
})

0 comments on commit a5612f9

Please sign in to comment.