diff options
| author | Ranke Johannes <johannes.ranke@agroscope.admin.ch> | 2025-10-22 10:35:37 +0200 |
|---|---|---|
| committer | Ranke Johannes <johannes.ranke@agroscope.admin.ch> | 2025-10-22 11:57:27 +0200 |
| commit | adc69bd4e1543a229fbee543940f8b92fd499682 (patch) | |
| tree | dcf08c3387f8e7d45290a1ce735896944376b8f3 /tests/testthat/test_pai.R | |
| parent | d6062331f8b3eacab729c6c2bfca0d24363d074c (diff) | |
Adapt to new SMILES names at PubChem
This may break some code using the old smiles names "PubChem_Canonical"
and "PubChem_Isomeric" instead of the new smiles names "PubChem"
(including isotopic and stereochemical information) and
"PubChem_Connectivity" (only containing connectivity, but still
canonical).
Further changes in this commit:
- A fix to the test target in the makefile
- Use markdown syntax for link to objects from other packages in the
documentation
- Adapt the tests
- Increase test coverage a bit
Diffstat (limited to 'tests/testthat/test_pai.R')
| -rw-r--r-- | tests/testthat/test_pai.R | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/testthat/test_pai.R b/tests/testthat/test_pai.R index 518fc56..f38672d 100644 --- a/tests/testthat/test_pai.R +++ b/tests/testthat/test_pai.R @@ -4,10 +4,13 @@ require(testthat) context("Generation of pai objects") -test_that("a pai object is correctly generated from an ambiguous name", { +test_that("a pai object is correctly generated", { skip_on_travis() # server certificate verification failed in curl_fetch_memory() - glyphosate <- pai$new("glyphosate", chyaml = FALSE) - expect_message(pai$new("benzalkonium chloride", chyaml = FALSE), "did not give results") + glyphosate <- pai$new("glyphosate") + + # This did not give results at BCPC in previous times, so it was used to test + # the corresponding warning. + #bc <- pai$new("benzalkonium chloride") expect_equivalent(glyphosate$bcpc$cas, "1071-83-6") expect_equivalent(glyphosate$bcpc$formula, "C3H8NO5P") @@ -18,5 +21,5 @@ test_that("a pai object is correctly generated from an ambiguous name", { expect_equal(glyphosate$inchikey, ik) expect_equivalent(round(glyphosate$mw, 2), 169.07) smiles <- "C(C(=O)O)NCP(=O)(O)O" - expect_equal(glyphosate$smiles[["PubChem_Canonical"]], smiles) + expect_equal(glyphosate$smiles[["PubChem"]], smiles) }) |
