Skip to content

Commit

Permalink
skip test if there are no NA in deploymentGroups, pass if one row is …
Browse files Browse the repository at this point in the history
…processed correctly
  • Loading branch information
PietrH committed Nov 6, 2023
1 parent 9d8361a commit 706592e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/testthat/test-read_camtrap_dp.R
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,19 @@ test_that("read deployments v1.0: boolean NA becomes a factor NA", {
expect_true(all(is.na(dp_v1_with_media$data$deployments$baitUse)))
})

test_that("read deployments v1.0: session is left empty", {
expect_true(all(is.na(dp_v1_with_media$data$deployments$session)))
})
test_that(
"read deployments v1.0: session is left empty when deploymentGroups is NA",{
skip_if(all(!is.na(
readr::read_csv(
file.path(dirname(path_to_json_v1), "deployments.csv"),
show_col_types = FALSE,
col_select = "deploymentGroups"
)
)), message = "All rows have value for deploymentGroups in deployments.csv")
expect_true(any(is.na(
dp_v1_with_media$data$deployments$session
)))
})

test_that("read deployments v1.0: array is left empty", {
expect_true(all(is.na(dp_v1_with_media$data$deployments$array)))
Expand Down

0 comments on commit 706592e

Please sign in to comment.