tests/testthat/test-20-get_projects.R

with_mock_dir(
  "../api/projects",
  test_that("get_projects() works", {
    project_in_options <- prep_entity_id(get_project_id())
    result <- get_projects()

    testthat::expect_type(result, "list")

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

    # Expect the project to be find in projects list
    testthat::expect_true(project_in_options %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.