tests/testthat/test-add-annotation.R

test_that("describe annotation works", {
  db <- rodm2::create_sqlite(connect = TRUE)
  myannotationtext = "test site group"
  suppressMessages(db_describe_annotation(db = db,
                                          annotationtext = myannotationtext,
                                          annotationtypecv = "Site group"))
  query_result <- RSQLite::dbGetQuery(db,
                                      "SELECT ann.annotationtext
                                      FROM annotations ann
                                      WHERE ann.annotationtext = :x",
                                      params=list(x = myannotationtext))
  DBI::dbDisconnect(db)

  expect_true(myannotationtext %in% query_result[["AnnotationText"]])
})
khondula/rodm2 documentation built on Jan. 9, 2020, 1:48 p.m.