Skip to content

Commit

Permalink
split off test, skip if no NA in deployments.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
PietrH committed Nov 6, 2023
1 parent 0813325 commit fb477ef
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/testthat/test-read_camtrap_dp.R
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,23 @@ test_that(
expect_identical(
levels(dp_v1_with_media$data$deployments$baitUse), baitUse_levels
)
# boolean NA becomes a factor NA
expect_true(all(is.na(dp_v1_with_media$data$deployments$baitUse)))
}
)

test_that("read deployments v1.0: boolean NA becomes a factor NA", {
## no longer present in the example package!
skip_if_not(any(is.na(
readr::read_csv(
file.path(dirname(path_to_json_v1), "deployments.csv"),
show_col_types = FALSE,
col_select = "baitUse"
)
)),
message = "There are no NA values present in deployments.baitUse")

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)))
})
Expand Down

0 comments on commit fb477ef

Please sign in to comment.