From 9a9ddbc30866fc01ae7128fb35e27800767317b3 Mon Sep 17 00:00:00 2001 From: Rob Marty Date: Fri, 19 Apr 2024 14:31:03 -0400 Subject: [PATCH] tests --- tests/testthat/test-bm_extract.R | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/testthat/test-bm_extract.R b/tests/testthat/test-bm_extract.R index 0057004..2d7e618 100644 --- a/tests/testthat/test-bm_extract.R +++ b/tests/testthat/test-bm_extract.R @@ -7,13 +7,13 @@ test_that("Query VNP46A1", { roi_sf <- geodata::gadm(country = "CHE", level = 0, path = tempdir()) # Daily data - r <- bm_extract(roi_sf = roi_sf, + ntl_df <- bm_extract(roi_sf = roi_sf, product_id = "VNP46A1", date = "2021-10-03", bearer = bearer) - expect_true(class(r) == "SpatRaster", - info = "r is not a SpatRaster object" + expect_true(class(ntl_df)[1] == "tbl_df", + info = "r is not a tibble" ) }) @@ -27,13 +27,13 @@ test_that("Query VNP46A2", { roi_sf <- geodata::gadm(country = "CHE", level = 0, path = tempdir()) # Daily data - r <- bm_extract(roi_sf = roi_sf, + ntl_df <- bm_extract(roi_sf = roi_sf, product_id = "VNP46A2", date = "2021-10-03", bearer = bearer) - expect_true(class(r) == "SpatRaster", - info = "r is not a SpatRaster object" + expect_true(class(ntl_df)[1] == "tbl_df", + info = "r is not a tibble" ) }) @@ -47,13 +47,13 @@ test_that("Query VNP46A3", { roi_sf <- geodata::gadm(country = "CHE", level = 0, path = tempdir()) # Daily data - r <- bm_extract(roi_sf = roi_sf, + ntl_df <- bm_extract(roi_sf = roi_sf, product_id = "VNP46A3", date = "2021-10", bearer = bearer) - expect_true(class(r) == "SpatRaster", - info = "r is not a SpatRaster object" + expect_true(class(ntl_df)[1] == "tbl_df", + info = "r is not a tibble" ) }) @@ -67,13 +67,13 @@ test_that("Query VNP46A4", { roi_sf <- geodata::gadm(country = "CHE", level = 0, path = tempdir()) # Daily data - r <- bm_extract(roi_sf = roi_sf, + ntl_df <- bm_extract(roi_sf = roi_sf, product_id = "VNP46A4", date = 2021, bearer = bearer) - expect_true(class(r) == "SpatRaster", - info = "r is not a SpatRaster object" + expect_true(class(ntl_df)[1] == "tbl_df", + info = "r is not a tibble" ) })