Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Liang Zhang <[email protected]>
  • Loading branch information
psychelzh committed Sep 1, 2023
1 parent 2a08d2c commit b3559ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
library(testthat)
Sys.setenv(TARFLOW.CACHE = "memory")
library(tarflow.iquizoo)

test_check("tarflow.iquizoo")
12 changes: 7 additions & 5 deletions tests/testthat/test-prepare_fetch_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ test_that("Smoke test", {
~course_name, ~course_period,
"509测试", "高中"
)
prepare_fetch_data(tbl_params) |>
expect_silent()
tbl_params <- tibble::tribble(
~course_name, ~course_period,
"11.14课程 测试", 0,
"509测试", 7
)
prepare_fetch_data(tbl_params) |>
expect_silent()

Expand All @@ -19,14 +26,9 @@ test_that("Smoke test", {
~course_name, ~course_period,
"Unexisted", 7
)
memoise::drop_cache(fetch_config_tbl_mem)("Unexisted", 0)
prepare_fetch_data(tbl_params_bad) |>
expect_warning(class = "tarflow_bad_params")
})

test_that("Work with `tar_make()", {
skip_if_not_installed("odbc")
skip_if(!"iquizoo-v3" %in% odbc::odbcListDataSources()$name)
targets::tar_dir({
targets::tar_script({
library(targets)
Expand Down

0 comments on commit b3559ff

Please sign in to comment.