Skip to content

Commit

Permalink
Merge pull request stemangiola#139 from myushen/master
Browse files Browse the repository at this point in the history
update testthat
  • Loading branch information
stemangiola authored May 1, 2024
2 parents 9be13af + d1e3d81 commit 7000b1f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/testthat/test-query.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test_that("sync_assay_files() syncs appropriate files", {
})

test_that("get_SingleCellExperiment() syncs appropriate files", {
temp <- get_default_cache_dir()
temp <- tempfile()
test_file <- "00095cb0de0dc9528316b636fc9b3446"

meta <- get_metadata() |> head(2)
Expand Down Expand Up @@ -196,12 +196,20 @@ test_that("database_url() expect character ", {
expect_s3_class("character")
})


test_that("get_metadata() expect a unique cell_type `b` is present, which comes from fibrosis database", {
n_cell <- get_metadata() |> filter(cell_type_harmonised == 'b') |> as_tibble() |> nrow()
expect_true(n_cell > 0)
})

test_that("import_metadata_counts() loads metadata from a SingleCellExperiment object into a parquet file", {
data(sample_sce_obj)
temp <- tempfile()
dataset_id <- "GSE122999"
import_metadata_counts(sce_obj = sample_sce_obj,
cache_dir = temp)



dataset_id %in% (get_metadata(cache_directory = temp) |>
dplyr::distinct(dataset_id) |>
dplyr::pull()) |>
expect(failure_message = "The correct metadata was not created")
})

0 comments on commit 7000b1f

Please sign in to comment.