tests/testthat/test-40-get_elements.R

with_mock_dir(
  "../api/elements",
  test_that("get_elements() works", {
    # Get the elements_list from env, make list by separating by comma
    elements_list_raw <- get_env("ELEMENT_IDS")
    elements_list <- strsplit(elements_list_raw, ",")
    element_id <- prep_entity_id(elements_list[[1]][1])

    # Get project from env
    result <- get_elements()

    testthat::expect_type(result, "list")

    # Expect at least one key in the list
    testthat::expect_true(length(result) > 0)

    # Expect a device to be in the list
    testthat::expect_true(element_id %in% names(result))
  })
)

Try the consibiocloudclient package in your browser

Any scripts or data that you put into this service are public.

consibiocloudclient documentation built on Sept. 12, 2024, 9:34 a.m.