Skip to content

Commit 58f6ee3

Browse files
committed
fix: arg-test assertions and DESCRIPTION cli import
1 parent 4c1ec7c commit 58f6ee3

7 files changed

Lines changed: 15 additions & 13 deletions

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
^\.circleci$
2424
^\.circleci/config\.yml$
2525
^\.github$
26+
^REFACTOR_GUIDE\.md$

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ Imports:
6969
gridExtra,
7070
data.table,
7171
methods,
72-
dplyr
72+
dplyr,
73+
cli
7374
Suggests:
7475
lme4,
7576
httr,

dsBase_7.0.0-permissive.tar.gz

341 Bytes
Binary file not shown.

tests/testthat/test-arg-ds.dataFrameFill.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC"))
2222
# context("ds.dataFrameFill::arg::test errors")
2323
test_that("dataFrameFill_erros", {
2424
expect_error(ds.dataFrameFill(), "Please provide the name of the data.frame to be filled as a character string: eg 'xxx'", fixed=TRUE)
25-
expect_error(ds.dataFrameFill("NonDF"), "The input object NonDF is not defined in sim1, sim2, sim3!", fixed=TRUE)
25+
expect_error(ds.dataFrameFill("NonDF"), "DataSHIELD errors")
2626
expect_error(ds.dataFrameFill("D$LAB_TSC"), "The input vector must be of type 'data.frame' or a 'matrix'!", fixed=TRUE)
2727
})
2828

tests/testthat/test-arg-ds.dataFrameSubset.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ test_that("dataFrameSubset_erros", {
5353
res.errors <- DSI::datashield.errors()
5454

5555
expect_length(res.errors, 3)
56-
expect_match(res.errors$sim1, "* object 'M' not found*")
57-
expect_match(res.errors$sim2, "* object 'M' not found*")
58-
expect_match(res.errors$sim3, "* object 'M' not found*")
56+
expect_match(res.errors$sim1, "The server-side object 'M' does not exist")
57+
expect_match(res.errors$sim2, "The server-side object 'M' does not exist")
58+
expect_match(res.errors$sim3, "The server-side object 'M' does not exist")
5959
})
6060

6161
# context("ds.dataFrameSubset::arg::missing 'V1' value server-side")
@@ -65,9 +65,9 @@ test_that("dataFrameSubset_erros", {
6565
res.errors <- DSI::datashield.errors()
6666

6767
expect_length(res.errors, 3)
68-
expect_match(res.errors$sim1, "* Error in eval\\(parse\\(text = V1.name\\), envir = parent.frame\\(\\)\\) : \\n object 'A' not found*")
69-
expect_match(res.errors$sim2, "* Error in eval\\(parse\\(text = V1.name\\), envir = parent.frame\\(\\)\\) : \\n object 'A' not found*")
70-
expect_match(res.errors$sim3, "* Error in eval\\(parse\\(text = V1.name\\), envir = parent.frame\\(\\)\\) : \\n object 'A' not found*")
68+
expect_match(res.errors$sim1, "The server-side object 'A' does not exist")
69+
expect_match(res.errors$sim2, "The server-side object 'A' does not exist")
70+
expect_match(res.errors$sim3, "The server-side object 'A' does not exist")
7171
})
7272

7373
# context("ds.dataFrameSubset::arg::missing 'V2' value server-side")
@@ -77,9 +77,9 @@ test_that("dataFrameSubset_erros", {
7777
res.errors <- DSI::datashield.errors()
7878

7979
expect_length(res.errors, 3)
80-
expect_match(res.errors$sim1, "* Error in eval\\(parse\\(text = V2.name\\), envir = parent.frame\\(\\)\\) : \\n object 'B' not found*")
81-
expect_match(res.errors$sim2, "* Error in eval\\(parse\\(text = V2.name\\), envir = parent.frame\\(\\)\\) : \\n object 'B' not found*")
82-
expect_match(res.errors$sim3, "* Error in eval\\(parse\\(text = V2.name\\), envir = parent.frame\\(\\)\\) : \\n object 'B' not found*")
80+
expect_match(res.errors$sim1, "The server-side object 'B' does not exist")
81+
expect_match(res.errors$sim2, "The server-side object 'B' does not exist")
82+
expect_match(res.errors$sim3, "The server-side object 'B' does not exist")
8383
})
8484

8585
# context("ds.dataFrameSubset::arg::invalid 'Boolean.operator' value server-side")

tests/testthat/test-arg-ds.merge.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC"))
2323
test_that("merge_erros", {
2424
expect_error(ds.merge(), "Please provide the name (eg 'name1') of first dataframe to be merged (called x) ", fixed=TRUE)
2525
expect_error(ds.merge(x.name="A"), "Please provide the name (eg 'name2') of second dataframe to be merged (called y) ", fixed=TRUE)
26-
expect_error(ds.merge(x.name="D$LAB_TSC", y.name="B"), "The input object B is not defined in sim1, sim2, sim3!", fixed=TRUE)
26+
expect_error(ds.merge(x.name="D$LAB_TSC", y.name="B", by.x.names="LAB_TSC", by.y.names="LAB_TSC"), "DataSHIELD errors")
2727
expect_error(ds.merge(x.name="D$LAB_TSC", y.name="D$LAB_TSC", by.x.names="C"), "Please provide the names of columns in y dataframe on which to merge (eg c('id', 'time'))", fixed=TRUE)
2828
expect_error(ds.merge(x.name="D$LAB_TSC", y.name="D$LAB_TSC", by.x.names="D$LAB_TSC", by.y.names="D", suffixes=NULL), "Please provide the suffixes to append to disambiguate duplicate column names (default = c('.x','.y'))", fixed=TRUE)
2929
})

tests/testthat/test-arg-ds.seq.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC"))
2121

2222
# context("ds.seq::arg::test errors")
2323
test_that("seq_erros", {
24-
expect_error(ds.seq(FROM.value.char="Test"), "object 'Test' not found", fixed=TRUE)
24+
expect_error(ds.seq(FROM.value.char="Test"), "'Test'")
2525
})
2626

2727
#

0 commit comments

Comments
 (0)