From f2df27887a0d44ec6443bb5ccc5a0401cceaf82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 23 Aug 2024 14:38:49 +0200 Subject: [PATCH] test: expectation closer to object --- tests/testthat/test-layers.R | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/testthat/test-layers.R b/tests/testthat/test-layers.R index fdcaf33..fb6e8ec 100644 --- a/tests/testthat/test-layers.R +++ b/tests/testthat/test-layers.R @@ -5,16 +5,16 @@ test_that("get layers works on server", { wfs = wfs, layers = c("mediseh_zostera_m_pnt", "mediseh_posidonia_nodata") ) - l_crs <- purrr::map_int(l_data, ~ sf::st_crs(.x)$epsg) %>% unique() - - expect_length(l_crs, 1L) - expect_identical(l_crs, 4326L) expect_type(l_data, "list") expect_length(l_data, 2L) expect_s3_class(l_data[[1]], class = c("sf", "data.frame")) expect_s3_class(l_data[[2]], class = c("sf", "data.frame")) expect_gt(nrow(l_data[[1]]), 0L) expect_gt(nrow(l_data[[2]]), 0L) + + l_crs <- purrr::map_int(l_data, ~ sf::st_crs(.x)$epsg) %>% unique() + expect_length(l_crs, 1L) + expect_identical(l_crs, 4326L) }) test_that("crs transform works from server", { @@ -36,16 +36,17 @@ test_that("get layers works on wfs object", { wfs <- create_biology_wfs() layers <- c("mediseh_zostera_m_pnt", "mediseh_posidonia_nodata") l_data <- emodnet_get_layers(wfs = wfs, layers = layers) - l_crs <- purrr::map_int(l_data, ~ sf::st_crs(.x)$epsg) %>% unique() - - expect_length(l_crs, 1L) - expect_identical(l_crs, 4326L) expect_type(l_data, "list") expect_length(l_data, 2L) expect_s3_class(l_data[[1]], class = c("sf", "data.frame")) expect_s3_class(l_data[[2]], class = c("sf", "data.frame")) expect_gt(nrow(l_data[[1]]), 0L) expect_gt(nrow(l_data[[2]]), 0L) + + l_crs <- purrr::map_int(l_data, ~ sf::st_crs(.x)$epsg) %>% unique() + + expect_length(l_crs, 1L) + expect_identical(l_crs, 4326L) }) test_that("crs transform works from wfs object", {