tests/testthat/test_assign_params.R

context("test that parameteers were assigned properly")

write("ATOM   7584  N   THR A1038      85.730  97.747  55.352  1.00 20.29           N", file ="test.pdb")

y <- Rpdb::read.pdb("test.pdb")
y2 <- assign_params(pdb_dataframe(y))

test_that("make sure right columns were added",{
expect_match(colnames(y2, do.NULL = TRUE, prefix = "col"),"Acidity", all=FALSE)
expect_match(colnames(y2, do.NULL = TRUE, prefix = "col"),"logP", all=FALSE)
})

test_that("make sure this won't work on a regular pdb object defined by Rpdb",{
expect_error(assign_params(y))
expect_error(assign_params(y$atoms))
})

test_that("make sure expected value has been added",{
expect_match(y2$Acidity,"Neutral")
})
zalperst/visualizeprot documentation built on May 4, 2019, 9:08 p.m.