Skip to content

Commit

Permalink
hobinder test fixed2
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoi committed Jun 13, 2024
1 parent f7227a6 commit 25fdf53
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tests/testthat/test-hobinder.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@ test_that("hobinder handles invalid paths", {

test_that("load hobo data with multiple files", {
path <- "inst/extdata/"
files <- list.files(path, full.names = TRUE, pattern = "\\.csv$")

hobofiles <- hobinder(path, skip = 1)
files <- hobinder(path, skip = 1)

# Check if the result is a data frame
expect_true(is.data.frame(hobofiles))
expect_true(is.data.frame(files))

# Check if the data frame is not empty
expect_gt(nrow(files), 0)

# Check if the data frame has expected columns
expect_named(hobofiles, c("X", "Date", "Wetness", "Temp", "RH", "Rain"))
expect_named(files, c("X", "Date", "Wetness", "Temp", "RH", "Rain"))

# Check if the data frame has data loaded from files
expect_true(all(file.exists(files)))
expect_true(all(file.exists(path)))
})



test_that("hobinder handles additional channels", {
pathoff <- "inst/extdata/"
pathon <- "inst/extdata/calibration/canopy1/"
Expand Down

0 comments on commit 25fdf53

Please sign in to comment.