tests/testthat/test.get_tissue_lists.R

context('get_tissue_lists')

# test HPA Tissue and genes
tissue <- c("blood","esophagus")
genes <- c('ANXA1', 'EEF1G', 'SNCA', 'WARS')
genes_null <- c("TEST1","TEST2","TEST3")




test_that('get_tissue_lists can return correct data.frame',{
  
  # Multiple tissues can be found
  table(hpa_rna$tissue)
  result <- get_tissue_list('skin 1',hpa_rna)
  expect_equal(result, hpa_rna[hpa_rna$tissue == 'skin 1',])
  
})

test_that('errors are prompted',{
  
  expect_error(get_tissue_list(3,hpa_rna))
  expect_error(get_tissue_list('myheart',hpa_rna))

})
lagelab/Genoppi documentation built on Oct. 13, 2022, 2:36 p.m.