Skip to content

Commit

Permalink
finish correcting unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdutey committed Nov 19, 2023
1 parent 6a2b3bf commit 0d54256
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions tests/testthat/test-objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -1037,38 +1037,28 @@ test_that("Encounter..interface_methods Postgres", {
)

# COMPUTE
expect_equal(
encounter_object@record$lazy_query$x$x,
structure("inpatient_episodes", class = c("ident", "character"))
)
expect_is(encounter_object@record$lazy_query$x$x, "dbplyr_table_ident")
expect_equal(vctrs::field(encounter_object@record$lazy_query$x$x, "table"), "inpatient_episodes")
encounter_object_computed <- compute(encounter_object)
expect_true(
grepl("^dbplyr_",
as.character(
encounter_object_computed@record$lazy_query$x
))
)
expect_equal(
encounter_object_multi@record$lazy_query$x$x,
structure("inpatient_episodes", class = c("ident", "character"))
vctrs::field(encounter_object_computed@record$lazy_query$x, "table"))
)

expect_is(encounter_object_multi@record$lazy_query$x$x, "dbplyr_table_ident")
expect_equal(vctrs::field(encounter_object_multi@record$lazy_query$x$x, "table"), "inpatient_episodes")
encounter_object_multi_computed <- compute(encounter_object_multi)
expect_true(
grepl("^dbplyr_",
as.character(
encounter_object_multi_computed@record$lazy_query$x
))
)
expect_equal(
encounter_object_multi5@record$lazy_query$x$x,
structure("inpatient_episodes", class = c("ident", "character"))
vctrs::field(encounter_object_multi_computed@record$lazy_query$x, "table"))
)

expect_is(encounter_object_multi5@record$lazy_query$x$x, "dbplyr_table_ident")
expect_equal(vctrs::field(encounter_object_multi5@record$lazy_query$x$x, "table"), "inpatient_episodes")
encounter_object_multi5_computed <- compute(encounter_object_multi5)
expect_true(
grepl("^dbplyr_",
as.character(
encounter_object_multi5_computed@record$lazy_query$x
))
vctrs::field(encounter_object_multi5_computed@record$lazy_query$x, "table"))
)

# COLLECT
Expand Down

0 comments on commit 0d54256

Please sign in to comment.