-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed broken test in dataset_metrics, made them better, tidied datase…
…t_metrics fxn
- Loading branch information
Showing
3 changed files
with
22 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
context("dataset_metrics") | ||
|
||
tt <- dataset_metrics(uuid='3f8a1297-3259-4700-91fc-acc4170b27ce') | ||
tt <- dataset_metrics('3f8a1297-3259-4700-91fc-acc4170b27ce') | ||
ss <- dataset_metrics(uuid=c('3f8a1297-3259-4700-91fc-acc4170b27ce', | ||
'66dd0960-2d7d-46ee-a491-87b9adcfe7b1')) | ||
|
||
test_that("returns the correct class", { | ||
test_that("dataset_metrics returns the correct class", { | ||
expect_is(tt, "list") | ||
expect_is(tt$key, "integer") | ||
expect_is(tt$datasetKey, "character") | ||
|
||
expect_is(ss, "list") | ||
expect_is(ss[[1]]$key, "integer") | ||
expect_is(ss[[2]]$datasetKey, "character") | ||
}) | ||
|
||
test_that("returns the correct value", { | ||
expect_equal(tt$key, 4341) | ||
expect_equal(tt$datasetKey, "3f8a1297-3259-4700-91fc-acc4170b27ce") | ||
test_that("dataset_metrics fails well", { | ||
expect_error(dataset_metrics(), "argument \"uuid\" is missing") | ||
expect_error(dataset_metrics("")) | ||
expect_error(dataset_metrics(c('3f8a1297-3259-4700-91fc-acc4170b27ce', 4))) | ||
}) |