From adc69bd4e1543a229fbee543940f8b92fd499682 Mon Sep 17 00:00:00 2001 From: Ranke Johannes Date: Wed, 22 Oct 2025 10:35:37 +0200 Subject: 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 --- tests/testthat/test_pai.R | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/testthat/test_pai.R') 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) }) -- cgit v1.2.3