Skip to content

Commit

Permalink
don't compare mugshot/file ids
Browse files Browse the repository at this point in the history
ref #539
  • Loading branch information
wibeasley committed Oct 13, 2024
1 parent c5be88d commit 99b7266
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ NA), dob = c("2003-08-30", "2003-03-10", "1934-04-09", "1952-11-02",
"A mouse character from a good book", "completely made up",
"This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail",
"Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache",
NA), mugshot = c(324901L, 324902L, 324903L, 324904L, 324905L,
NA), race___1 = c(FALSE, FALSE, FALSE, FALSE, TRUE, FALSE
), race___2 = c(FALSE, FALSE, FALSE, TRUE, FALSE, FALSE),
race___3 = c(FALSE, TRUE, FALSE, FALSE, FALSE, FALSE), race___4 = c(FALSE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ NA), dob = c("2003-08-30", "2003-03-10", "1934-04-09", "1952-11-02",
"A mouse character from a good book", "completely made up",
"This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail",
"Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache",
NA), mugshot = c(324901L, 324902L, 324903L, 324904L, 324905L,
NA), race___1 = c(FALSE, FALSE, FALSE, FALSE, TRUE, FALSE
), race___2 = c(FALSE, FALSE, FALSE, TRUE, FALSE, FALSE),
race___3 = c(FALSE, TRUE, FALSE, FALSE, FALSE, FALSE), race___4 = c(FALSE,
Expand Down
21 changes: 16 additions & 5 deletions tests/testthat/test-read-oneshot-eav.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,16 @@ test_that("blank-for-gray-status-true", {
verbose = FALSE
)

if (update_expectation) save_expected(returned_object$data, path_expected)
d <-
returned_object$data |>
dplyr::select(
-mugshot # Don't compare file IDs across servers.
)

if (update_expectation) save_expected(d, path_expected)
expected_data_frame <- retrieve_expected(path_expected)

expect_equal(returned_object$data, expected=expected_data_frame, label="The returned data.frame should be correct", ignore_attr = TRUE) # dput(returned_object$data)
expect_equal(d, expected=expected_data_frame, label="The returned data.frame should be correct", ignore_attr = TRUE) # dput(returned_object$data)
expect_equal(returned_object$status_code, expected=200L)
expect_equal(returned_object$raw_text, expected="", ignore_attr = TRUE) # dput(returned_object$raw_text)
expect_true(returned_object$records_collapsed=="", "A subset of records was not requested.")
Expand All @@ -274,10 +280,16 @@ test_that("blank-for-gray-status-false", {
verbose = FALSE
)

if (update_expectation) save_expected(returned_object$data, path_expected)
d <-
returned_object$data |>
dplyr::select(
-mugshot # Don't compare file IDs across servers.
)

if (update_expectation) save_expected(d, path_expected)
expected_data_frame <- retrieve_expected(path_expected)

expect_equal(returned_object$data, expected=expected_data_frame, label="The returned data.frame should be correct", ignore_attr = TRUE) # dput(returned_object$data)
expect_equal(d, expected=expected_data_frame, label="The returned data.frame should be correct", ignore_attr = TRUE) # dput(returned_object$data)
expect_equal(returned_object$status_code, expected=200L)
expect_equal(returned_object$raw_text, expected="", ignore_attr = TRUE) # dput(returned_object$raw_text)
expect_true(returned_object$records_collapsed=="", "A subset of records was not requested.")
Expand All @@ -287,7 +299,6 @@ test_that("blank-for-gray-status-false", {
expect_true(returned_object$success)
expect_s3_class(returned_object$data, "tbl")
})

test_that("date-range", {
testthat::skip_on_cran()
path_expected <- "test-data/specific-redcapr/read-oneshot-eav/default.R"
Expand Down

0 comments on commit 99b7266

Please sign in to comment.