Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anngvu committed Nov 15, 2024
1 parent 0ed731b commit 0466174
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
9 changes: 9 additions & 0 deletions tests/testthat/test_annotate_with_manifest.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test_that("annotate_with_manifest works by annotating files with `data.table` manifest", {

modify_annotation

testthat::expect_identical(update_items(current, update),
expected)

})

19 changes: 17 additions & 2 deletions tests/testthat/test_manifest_annotations.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ test_that("Annotate with manifest works", {
skip_if_no_login()

PARENT_TEST_PROJECT <- "syn26462036"
testthat::expect_equal(1,1)

# Use some folders to represent objects to annotate
objs <- make_folder(parent = PARENT_TEST_PROJECT, folders = c("mock_file_1", "mock_file_2", "mock_file_3"))
ids <- sapply(objs, function(x) x$properties$id)
# Partial manifest as a data.table with list columns
manifest <- data.table(
entityId = ids,
assay = "drugScreen",
experimentalTimepoint = c(1L, 3L, 7L),
experimentalTimepointUnit = "days",
cellType = list(c("schwann", "macrophage"), c("schwann", "macrophage"), c("schwann", "macrophage"))
)
annotate_with_manifest(manifest)
remanifested <- list()
for(i in ids) {
remanifested[[i]] <- .syn$get_annotations(i)
}
for(i in ids) .syn$delete(i)
})

0 comments on commit 0466174

Please sign in to comment.