diff --git a/DESCRIPTION b/DESCRIPTION index b26c7ab..07291f8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -9,13 +9,11 @@ Authors@R: c( person("Research Institute for Nature and Forest (INBO)", role = "cph", comment = "https://www.vlaanderen.be/inbo/en-gb/"), person("LifeWatch Belgium", role = "fnd", - comment = "https://lifewatch.be")) -Description: Provides API endpoints to the European Tracking Network. Designed - to be used with OpenCPU and the 'etn' package. + comment = "https://lifewatch.be") + ) +Description: Provides API endpoints to the European Tracking Network. + Designed to be used with OpenCPU and the 'etn' package. License: MIT + file LICENSE -Encoding: UTF-8 -Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 Imports: assertthat, DBI, @@ -28,3 +26,9 @@ Imports: odbc, readr, stringr +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.3.2 +Suggests: + testthat (>= 3.0.0) +Config/testthat/edition: 3 diff --git a/R/connect_to_etn.R b/R/connect_to_etn.R index f3a955f..3cdfe91 100644 --- a/R/connect_to_etn.R +++ b/R/connect_to_etn.R @@ -19,11 +19,28 @@ #' con <- connect_to_etn(username = "my_username", password = "my_password") #' } connect_to_etn <- function(username, password) { - connection <- DBI::dbConnect( - odbc::odbc(), - "ETN", - uid = paste("", tolower(username), "", sep = ""), - pwd = paste("", password, "", sep = "") + tryCatch( + { + # Attempt to connect to the database with the provided credentials + connection <- DBI::dbConnect( + odbc::odbc(), + "ETN", + uid = paste("", tolower(username), "", sep = ""), + pwd = paste("", password, "", sep = "") + ) + return(connection) + }, + error = function(e) { + # When the database connection fails, return the error message and some + # directions to try again. This is usually due to a wrong password, so + # let's include that as a clue in the error message. + stop(glue::glue(e$message, + "Failed to connect to the database.", + "Did you enter the right username/password?", + "Please try again.", + .sep = "\n"), + call. = FALSE) + + } ) - return(connection) } diff --git a/R/get_acoustic_deployments.R b/R/get_acoustic_deployments.R index 6e07dea..cd9e049 100644 --- a/R/get_acoustic_deployments.R +++ b/R/get_acoustic_deployments.R @@ -52,6 +52,9 @@ get_acoustic_deployments <- function( station_name = NULL, open_only = FALSE) { + # Check if credentials object has right shape + check_credentials(credentials) + # create connection object connection <- connect_to_etn(credentials$username, credentials$password) diff --git a/R/get_acoustic_detections.R b/R/get_acoustic_detections.R index f35f96d..4d978f6 100644 --- a/R/get_acoustic_detections.R +++ b/R/get_acoustic_detections.R @@ -90,6 +90,8 @@ get_acoustic_detections <- function(credentials = list( station_name = NULL, limit = FALSE) { + # Check if credentials object has right shape + check_credentials(credentials) # Create connection object connection <- connect_to_etn(credentials$username, credentials$password) @@ -215,7 +217,7 @@ get_acoustic_detections <- function(credentials = list( } acoustic_tag_id_sql <- glue::glue_sql( - readr::read_file(system.file("sql", "acoustic_tag_id.sql", package = "etn")), + readr::read_file(system.file("sql", "acoustic_tag_id.sql", package = "etnservice")), .con = connection ) diff --git a/R/get_acoustic_projects.R b/R/get_acoustic_projects.R index 082f27e..8bb5e92 100644 --- a/R/get_acoustic_projects.R +++ b/R/get_acoustic_projects.R @@ -29,6 +29,10 @@ get_acoustic_projects <- function(credentials = list( password = Sys.getenv("pwd") ), acoustic_project_code = NULL) { + + # Check if credentials object has right shape + check_credentials(credentials) + # create connection object connection <- connect_to_etn(credentials$username, credentials$password) @@ -53,7 +57,7 @@ get_acoustic_projects <- function(credentials = list( } project_sql <- glue::glue_sql( - readr::read_file(system.file("sql", "project.sql", package = "etn")), + readr::read_file(system.file("sql", "project.sql", package = "etnservice")), .con = connection ) diff --git a/R/get_acoustic_receivers.R b/R/get_acoustic_receivers.R index d6570ab..dfdca3d 100644 --- a/R/get_acoustic_receivers.R +++ b/R/get_acoustic_receivers.R @@ -66,11 +66,11 @@ get_acoustic_receivers <- function(credentials = list( } receiver_sql <- glue::glue_sql( - readr::read_file(system.file("sql", "receiver.sql", package = "etn")), + readr::read_file(system.file("sql", "receiver.sql", package = "etnservice")), .con = connection ) acoustic_tag_id_sql <- glue::glue_sql( - readr::read_file(system.file("sql", "acoustic_tag_id.sql", package = "etn")), + readr::read_file(system.file("sql", "acoustic_tag_id.sql", package = "etnservice")), .con = connection ) diff --git a/R/get_animal_projects.R b/R/get_animal_projects.R index c552644..96571b2 100644 --- a/R/get_animal_projects.R +++ b/R/get_animal_projects.R @@ -29,6 +29,10 @@ get_animal_projects <- function(credentials = list( password = Sys.getenv("pwd") ), animal_project_code = NULL) { + + # Check if credentials object has right shape + check_credentials(credentials) + # Create connection object connection <- connect_to_etn(credentials$username, credentials$password) @@ -52,7 +56,7 @@ get_animal_projects <- function(credentials = list( } project_sql <- glue::glue_sql( - readr::read_file(system.file("sql", "project.sql", package = "etn")), + readr::read_file(system.file("sql", "project.sql", package = "etnservice")), .con = connection ) diff --git a/R/get_animals.R b/R/get_animals.R index 4317be2..18ee4e3 100644 --- a/R/get_animals.R +++ b/R/get_animals.R @@ -52,6 +52,10 @@ get_animals <- function(credentials = list( tag_serial_number = NULL, animal_project_code = NULL, scientific_name = NULL) { + + # Check if credentials object has right shape + check_credentials(credentials) + # Create connection object connection <- connect_to_etn(credentials$username, credentials$password) @@ -121,7 +125,7 @@ get_animals <- function(credentials = list( } tag_sql <- glue::glue_sql( - readr::read_file(system.file("sql", "tag.sql", package = "etn")), + readr::read_file(system.file("sql", "tag.sql", package = "etnservice")), .con = connection ) diff --git a/R/get_cpod_projects.R b/R/get_cpod_projects.R index 459b17c..ef31e30 100644 --- a/R/get_cpod_projects.R +++ b/R/get_cpod_projects.R @@ -29,6 +29,10 @@ get_cpod_projects <- function(credentials = list( password = Sys.getenv("pwd") ), cpod_project_code = NULL) { + + # Check if credentials object has right shape + check_credentials(credentials) + # Create connection object connection <- connect_to_etn(credentials$username, credentials$password) @@ -52,7 +56,7 @@ get_cpod_projects <- function(credentials = list( } project_sql <- glue::glue_sql( - readr::read_file(system.file("sql", "project.sql", package = "etn")), + readr::read_file(system.file("sql", "project.sql", package = "etnservice")), .con = connection ) diff --git a/R/get_tags.R b/R/get_tags.R index a370801..23886e4 100644 --- a/R/get_tags.R +++ b/R/get_tags.R @@ -49,6 +49,9 @@ get_tags <- function(credentials = list( tag_serial_number = NULL, acoustic_tag_id = NULL) { + # Check if credentials object has right shape + check_credentials(credentials) + # Create connection object connection <- connect_to_etn(credentials$username, credentials$password) @@ -116,7 +119,7 @@ get_tags <- function(credentials = list( } tag_sql <- glue::glue_sql( - readr::read_file(system.file("sql", "tag.sql", package = "etn")), + readr::read_file(system.file("sql", "tag.sql", package = "etnservice")), .con = connection ) diff --git a/R/list_acoustic_project_codes.R b/R/list_acoustic_project_codes.R index 0289c76..cc6d181 100644 --- a/R/list_acoustic_project_codes.R +++ b/R/list_acoustic_project_codes.R @@ -13,7 +13,7 @@ list_acoustic_project_codes <- function(credentials = list( connection <- connect_to_etn(credentials$username, credentials$password) project_sql <- glue::glue_sql( - readr::read_file(system.file("sql", "project.sql", package = "etn")), + readr::read_file(system.file("sql", "project.sql", package = "etnservice")), .con = connection ) query <- glue::glue_sql( diff --git a/R/list_acoustic_tag_ids.R b/R/list_acoustic_tag_ids.R index a98e4f0..ab4d4bd 100644 --- a/R/list_acoustic_tag_ids.R +++ b/R/list_acoustic_tag_ids.R @@ -11,7 +11,7 @@ list_acoustic_tag_ids <- function(credentials = list( )) { connection <- connect_to_etn(credentials$username, credentials$password) acoustic_tag_id_sql <- glue::glue_sql( - readr::read_file(system.file("sql", "acoustic_tag_id.sql", package = "etn")), + readr::read_file(system.file("sql", "acoustic_tag_id.sql", package = "etnservice")), .con = connection ) query <- glue::glue_sql(" diff --git a/R/list_animal_project_codes.R b/R/list_animal_project_codes.R index ce58c15..e8328ad 100644 --- a/R/list_animal_project_codes.R +++ b/R/list_animal_project_codes.R @@ -13,7 +13,7 @@ list_animal_project_codes <- function(credentials = list( connection <- connect_to_etn(credentials$username, credentials$password) project_sql <- glue::glue_sql( - readr::read_file(system.file("sql", "project.sql", package = "etn")), + readr::read_file(system.file("sql", "project.sql", package = "etnservice")), .con = connection ) query <- glue::glue_sql( diff --git a/R/list_cpod_project_codes.R b/R/list_cpod_project_codes.R index b7085e0..445267c 100644 --- a/R/list_cpod_project_codes.R +++ b/R/list_cpod_project_codes.R @@ -11,6 +11,9 @@ list_cpod_project_codes <- function(credentials = list( password = Sys.getenv("pwd") )) { + # Check if credentials object has right shape + check_credentials(credentials) + # Create connection object connection <- connect_to_etn(credentials$username, credentials$password) @@ -18,7 +21,7 @@ list_cpod_project_codes <- function(credentials = list( check_connection(connection) project_query <- glue::glue_sql( - readr::read_file(system.file("sql", "project.sql", package = "etn")), + readr::read_file(system.file("sql", "project.sql", package = "etnservice")), .con = connection ) query <- glue::glue_sql( diff --git a/R/list_scientific_names.R b/R/list_scientific_names.R index 37e815d..0780fd8 100644 --- a/R/list_scientific_names.R +++ b/R/list_scientific_names.R @@ -10,7 +10,7 @@ list_scientific_names <- function(credentials = list( username = Sys.getenv("userid"), password = Sys.getenv("pwd") )) { - connection <- connection <- connect_to_etn(credentials$username, credentials$password) + connection <- connect_to_etn(credentials$username, credentials$password) query <- glue::glue_sql( "SELECT DISTINCT scientific_name FROM common.animal_release", .con = connection diff --git a/R/utils.R b/R/utils.R index 5e723f6..62e5ab3 100644 --- a/R/utils.R +++ b/R/utils.R @@ -110,6 +110,49 @@ get_credentials <- stringr::str_glue('list(username = "{username}", password = "{password}")') } +#' Check if the provided credentials are valid. +#' +#' This function checks if the provided credentials contain a "username" and "password" field, +#' and if both fields are of type character. It also verifies that the credentials object has a length of 2. +#' +#' @param credentials A list or data frame containing the credentials to be checked. +#' +#' @return TRUE if the credentials are valid, an error otherwise +#' +#' @examples +#' \dontrun{ +#' credentials <- list(username = "john_doe", password = "password123") +#' check_credentials(credentials) +#' #> [1] TRUE +#' } +check_credentials <- function(credentials) { + + assertthat::assert_that( + assertthat::has_name(credentials, "username"), + msg = "The credentials need to contain a 'username' field." + ) + + assertthat::assert_that( + assertthat::has_name(credentials, "password"), + msg = "The credentials need to contain a 'password' field." + ) + + assertthat::assert_that( + length(credentials) == 2, + msg = "The credentials object should have a length of 2." + ) + + assertthat::assert_that( + assertthat::is.string(credentials$username) + ) + + assertthat::assert_that( + assertthat::is.string(credentials$password) + ) + + return(TRUE) +} + #' Extract the OCPU temp key from a response object #' #' When posting a request to the opencpu api service without the json flag, a diff --git a/inst/postman-helpers/find-postman-test-mismatch.R b/inst/postman-helpers/find-postman-test-mismatch.R index 5b26aba..244f1c6 100644 --- a/inst/postman-helpers/find-postman-test-mismatch.R +++ b/inst/postman-helpers/find-postman-test-mismatch.R @@ -11,6 +11,7 @@ library(httr2) fn_to_test <- "list_acoustic_tag_ids" + # get reponse ------------------------------------------------------------- diff --git a/man/check_credentials.Rd b/man/check_credentials.Rd new file mode 100644 index 0000000..72838d0 --- /dev/null +++ b/man/check_credentials.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{check_credentials} +\alias{check_credentials} +\title{Check if the provided credentials are valid.} +\usage{ +check_credentials(credentials) +} +\arguments{ +\item{credentials}{A list or data frame containing the credentials to be checked.} +} +\value{ +TRUE if the credentials are valid, an error otherwise +} +\description{ +This function checks if the provided credentials contain a "username" and "password" field, +and if both fields are of type character. It also verifies that the credentials object has a length of 2. +} +\examples{ +\dontrun{ +credentials <- list(username = "john_doe", password = "password123") +check_credentials(credentials) +#> [1] TRUE +} +} diff --git a/tests/testthat.R b/tests/testthat.R new file mode 100644 index 0000000..622aa33 --- /dev/null +++ b/tests/testthat.R @@ -0,0 +1,12 @@ +# This file is part of the standard setup for testthat. +# It is recommended that you do not modify it. +# +# Where should you do additional test configuration? +# Learn more about the roles of various files in: +# * https://r-pkgs.org/tests.html +# * https://testthat.r-lib.org/reference/test_package.html#special-files + +library(testthat) +library(etnservice) + +test_check("etnservice") diff --git a/tests/testthat/test-connect_to_etn.R b/tests/testthat/test-connect_to_etn.R index c31fbb9..3bb4558 100644 --- a/tests/testthat/test-connect_to_etn.R +++ b/tests/testthat/test-connect_to_etn.R @@ -8,3 +8,14 @@ test_that("connect_to_etn() allows to create a connection with passed credential expect_true(isClass(connection, "PostgreSQL")) DBI::dbDisconnect(connection) }) + +test_that("connect_to_etn() returns a clear error when connecting to db fails",{ + expect_error(connect_to_etn("only one argument"), + regexp = "Failed to connect to the database.") + expect_error(connect_to_etn(password = "missing username"), + regexp = "Failed to connect to the database.") + expect_error(connect_to_etn(username = "missing password"), + regexp = "Failed to connect to the database.") + expect_error(connect_to_etn(username = "", password = ""), + regexp = "Failed to connect to the database.") +}) diff --git a/tests/testthat/test-get_acoustic_deployments.R b/tests/testthat/test-get_acoustic_deployments.R index 81a7552..f181c10 100644 --- a/tests/testthat/test-get_acoustic_deployments.R +++ b/tests/testthat/test-get_acoustic_deployments.R @@ -6,7 +6,13 @@ credentials <- list( test_that("get_acoustic_deployments() returns error for incorrect connection", { expect_error( get_acoustic_deployments(credentials = "not_a_credentials"), - "Not a credentials object to database." + "The credentials need to contain a 'username' field", + fixed = TRUE + ) + expect_error( + get_acoustic_deployments(credentials = list(username = "not a username", + password = "the wrong password")), + "Failed to connect to the database." ) }) diff --git a/tests/testthat/test-get_acoustic_detections.R b/tests/testthat/test-get_acoustic_detections.R index ab1b37a..450fd64 100644 --- a/tests/testthat/test-get_acoustic_detections.R +++ b/tests/testthat/test-get_acoustic_detections.R @@ -6,17 +6,33 @@ credentials <- list( test_that("get_acoustic_detections() returns error for incorrect connection", { expect_error( get_acoustic_detections(credentials = "not_a_connection"), - "Not a connection object to database." + "The credentials need to contain a 'username' field." + ) + expect_error( + get_acoustic_detections(credentials = list(username = "username")), + "The credentials need to contain a 'password' field." + ) + expect_error( + get_acoustic_detections(credentials = list(unexpected_field = 4, + username = "username", + password = "not a password")), + "The credentials object should have a length of 2." + ) + expect_error( + get_acoustic_detections(credentials = list(username = "not a username", + password = "the wrong pwd")), + "Failed to connect to the database." ) }) -test_that("get_acoustic_detections() returns a tibble", { + test_that("get_acoustic_detections() returns a tibble", { df <- get_acoustic_detections(credentials, limit = TRUE) expect_s3_class(df, "data.frame") expect_s3_class(df, "tbl") }) test_that("get_acoustic_detections() returns unique detection_id", { + skip("duplicate detection ids: https://github.com/inbo/etn/issues/283") df <- get_acoustic_detections(credentials, limit = TRUE) expect_equal(nrow(df), nrow(df %>% distinct(detection_id))) }) @@ -281,19 +297,20 @@ test_that("get_acoustic_detections() returns acoustic and acoustic-archival tags }) # TODO: re-enable after https://github.com/inbo/etn/issues/252 -# test_that("get_acoustic_detections() returns detections from acoustic_tag_id_alternative", { -# # The following acoustic_tag_ids only occur as acoustic_tag_id_alternative -# -# # A69-1105-26 (tag_serial_number = 1734026) is associated with animal -# # - 5902 (2017_Fremur) from 2017-12-01 00:00 to open -# # Almost all its detections are from after the release date -# expect_gt(nrow(get_acoustic_detections(credentials, acoustic_tag_id = "A69-1105-26")), 0) -# -# # A69-1105-155 (tag_serial_number = 1712155) is associated with animal -# # - 4140 (OTN-Skjerstadfjorden) from 2017-05-31 01:00 to open -# # All detections are from before the release date, so it should return 0 -# expect_equal(nrow(get_acoustic_detections(credentials, acoustic_tag_id = "A69-1105-155")), 0) -# }) +test_that("get_acoustic_detections() returns detections from acoustic_tag_id_alternative", { + skip("TODO: re-enable after https://github.com/inbo/etn/issues/252") + # The following acoustic_tag_ids only occur as acoustic_tag_id_alternative + + # A69-1105-26 (tag_serial_number = 1734026) is associated with animal + # - 5902 (2017_Fremur) from 2017-12-01 00:00 to open + # Almost all its detections are from after the release date + expect_gt(nrow(get_acoustic_detections(credentials, acoustic_tag_id = "A69-1105-26")), 0) + + # A69-1105-155 (tag_serial_number = 1712155) is associated with animal + # - 4140 (OTN-Skjerstadfjorden) from 2017-05-31 01:00 to open + # All detections are from before the release date, so it should return 0 + expect_equal(nrow(get_acoustic_detections(credentials, acoustic_tag_id = "A69-1105-155")), 0) +}) test_that("get_acoustic_detections() does not return duplicate detections across acoustic_id and acoustic_id_alternative", { # A69-1105-100 is used as acoustic_tag_id once and acoustic_tag_id_alternative twice: @@ -304,7 +321,8 @@ test_that("get_acoustic_detections() does not return duplicate detections across # Expect no duplicates df <- get_acoustic_detections(credentials, acoustic_tag_id = "A69-1105-100") - # expect_equal(nrow(df), nrow(df %>% distinct(detection_id))) # TODO: https://github.com/inbo/etn/issues/216 + skip("TODO: https://github.com/inbo/etn/issues/216") + expect_equal(nrow(df), nrow(df %>% distinct(detection_id))) # TODO: https://github.com/inbo/etn/issues/216 }) test_that("get_acoustic_detections() does not return duplicate detections when tags are reused", { diff --git a/tests/testthat/test-get_acoustic_projects.R b/tests/testthat/test-get_acoustic_projects.R index b850c58..32a34e9 100644 --- a/tests/testthat/test-get_acoustic_projects.R +++ b/tests/testthat/test-get_acoustic_projects.R @@ -6,7 +6,12 @@ credentials <- list( test_that("get_acoustic_projects() returns error for incorrect connection", { expect_error( get_acoustic_projects(credentials = "not_a_credentials"), - "Not a connection object to database." + "The credentials need to contain a 'username' field." + ) + expect_error( + get_acoustic_projects(credentials = list(username = "not a username", + password = "the wrong pwd")), + "Failed to connect to the database." ) }) diff --git a/tests/testthat/test-get_acoustic_receivers.R b/tests/testthat/test-get_acoustic_receivers.R index 5c13f8b..847698b 100644 --- a/tests/testthat/test-get_acoustic_receivers.R +++ b/tests/testthat/test-get_acoustic_receivers.R @@ -6,7 +6,12 @@ credentials <- list( test_that("get_acoustic_receivers() returns error for incorrect credentials", { expect_error( get_acoustic_receivers(credentials = "not_a_credentials"), - "Not a connection object to database." + "Failed to connect to the database." + ) + expect_error( + get_acoustic_receivers(credentials = list(username = "not a username", + password = "the wrong pwd")), + "Failed to connect to the database." ) }) diff --git a/tests/testthat/test-get_animal_projects.R b/tests/testthat/test-get_animal_projects.R index 71f0dbf..2cffc64 100644 --- a/tests/testthat/test-get_animal_projects.R +++ b/tests/testthat/test-get_animal_projects.R @@ -6,7 +6,12 @@ credentials <- list( test_that("get_animal_projects() returns error for incorrect connection", { expect_error( get_animal_projects(credentials = "not_a_connection"), - "Not a connection object to database." + "The credentials need to contain a 'username' field." + ) + expect_error( + get_animal_projects(credentials = list(username = "not a username", + password = "the wrong pwd")), + "Failed to connect to the database." ) }) diff --git a/tests/testthat/test-get_animals.R b/tests/testthat/test-get_animals.R index 6ddab45..bc000e7 100644 --- a/tests/testthat/test-get_animals.R +++ b/tests/testthat/test-get_animals.R @@ -6,7 +6,12 @@ credentials <- list( test_that("get_animals() returns error for incorrect connection", { expect_error( get_animals(credentials = "not_a_connection"), - "Not a connection object to database." + "The credentials need to contain a 'username' field." + ) + expect_error( + get_animals(credentials = list(username = "not a username", + password = "the wrong pwd")), + "Failed to connect to the database." ) }) diff --git a/tests/testthat/test-get_cpod_projects.R b/tests/testthat/test-get_cpod_projects.R index 09f835f..a9e2d0b 100644 --- a/tests/testthat/test-get_cpod_projects.R +++ b/tests/testthat/test-get_cpod_projects.R @@ -6,7 +6,12 @@ credentials <- list( test_that("get_cpod_projects() returns error for incorrect connection", { expect_error( get_cpod_projects(credentials = "not_a_connection"), - "Not a connection object to database." + "The credentials need to contain a 'username' field." + ) + expect_error( + get_cpod_projects(credentials = list(username = "not a username", + password = "the wrong pwd")), + "Failed to connect to the database." ) }) diff --git a/tests/testthat/test-get_tags.R b/tests/testthat/test-get_tags.R index 19aeb22..1a1bced 100644 --- a/tests/testthat/test-get_tags.R +++ b/tests/testthat/test-get_tags.R @@ -5,8 +5,9 @@ credentials <- list( test_that("get_tags() returns error for incorrect connection", { expect_error( - get_tags(credentials = "not_a_connection"), - "Not a connection object to database." + get_tags(credentials = list(username = "not a username", + password = "not a password")), + "Failed to connect to the database." ) }) diff --git a/tests/testthat/test-list_receiver_ids.R b/tests/testthat/test-list_receiver_ids.R index a657d73..2f93201 100644 --- a/tests/testthat/test-list_receiver_ids.R +++ b/tests/testthat/test-list_receiver_ids.R @@ -3,12 +3,21 @@ credentials <- list( password = Sys.getenv("pwd") ) +vector <- list_receiver_ids(credentials) + test_that("list_receiver_ids() returns unique list of values", { - vector <- list_receiver_ids(credentials) + expect_false(any(duplicated(vector))) +}) +test_that("list_receiver_ids() returns a character vector", { expect_is(vector, "character") - expect_false(any(duplicated(vector))) +}) + +test_that("list_receiver_ids() does not return NA values", { + skip("Empty receiver value in acoustic.receivers, ISSUE https://github.com/inbo/etn/issues/333") expect_true(all(!is.na(vector))) +}) +test_that("list_receiver_ids() returns known value", { expect_true("VR2W-124070" %in% vector) })