From e46b4924417f3e7bf4a338f07078ab7379d32265 Mon Sep 17 00:00:00 2001 From: edisz Date: Sat, 3 Feb 2018 17:46:10 +0100 Subject: [PATCH] housekeeping for PR #142 --- NEWS | 1 + tests/testthat/test-chemspider.R | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a0e7b7b7..efa1391c 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ BUG FIXES * extr_num() did not work properly with decimal numbers [issue #136, reported and fixed by @stanstrup] * cs_prop() failed when epi-suite data was not available [issue #139, reported and fixed by @stanstrup] * cs_prop() failed with invalid html [issue #138, reported and fixed by @stanstrup] +* cs_prop() gave incorrect answer, if entries were not available [issue #142, reported and fixed by @stanstrup] * is.smiles() failed because of changes in rcdk [PR #140, reported and fixed by @allaway] DEPRECATED FUNCTIONS diff --git a/tests/testthat/test-chemspider.R b/tests/testthat/test-chemspider.R index d60de940..1220ddc6 100644 --- a/tests/testthat/test-chemspider.R +++ b/tests/testthat/test-chemspider.R @@ -81,7 +81,21 @@ test_that("cs_prop()", { expect_true(nrow(m3$`21106900`$epi) == 0) # issue #138 (invalid chemspider html) - expect_error(cs_prop(8012), NA) + m3 <- cs_prop(8012) + expect_is(m3, 'list') + expect_equal(length(m3), 1) + expect_equal(length(m3[[1]]), 3) + expect_is(m3[[1]]$epi, 'data.frame') + expect_is(m3[[1]]$acd, 'data.frame') + + # issue #142 + m4 <- cs_prop(391783) + expect_is(m4, 'list') + expect_equal(length(m4), 1) + expect_equal(length(m4[[1]]), 3) + expect_is(m4[[1]]$epi, 'data.frame') + expect_is(m4[[1]]$acd, 'data.frame') + })