Skip to content

Commit

Permalink
fix(test-drop_diseasystore): Simplify clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte committed Feb 27, 2024
1 parent 988e78a commit 0208318
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions tests/testthat/test-drop_diseasystore.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,10 @@ test_that("drop_diseasystore can delete entire default schema", {
expect_true(DBI::dbExistsTable(conn, ids[[4]]))

# Make sure all tables have been removed
c(paste(target_schema_1, "logs", sep = "."),
paste(target_schema_1, "mtcars_1", sep = "."),
paste(target_schema_1, "mtcars_2", sep = "."),
"mtcars_1",
paste(target_schema_2, "mtcars_1", sep = ".")
) |>
c(SCDB::id(paste(target_schema_1, "logs", sep = "."), conn), ids) |>
purrr::walk(~ {
if (DBI::dbExistsTable(conn, .)) {
DBI::dbRemoveTable(conn, SCDB::id(., conn))
DBI::dbRemoveTable(conn, .)
}
expect_false(DBI::dbExistsTable(conn, .))
})
Expand Down Expand Up @@ -111,15 +106,10 @@ test_that("drop_diseasystore can delete single table in default schema", {


# Make sure all tables have been removed
c(paste(target_schema_1, "logs", sep = "."),
paste(target_schema_1, "mtcars_1", sep = "."),
paste(target_schema_1, "mtcars_2", sep = "."),
"mtcars_1",
paste(target_schema_2, "mtcars_1", sep = ".")
) |>
c(SCDB::id(paste(target_schema_1, "logs", sep = "."), conn), ids) |>
purrr::walk(~ {
if (DBI::dbExistsTable(conn, .)) {
DBI::dbRemoveTable(conn, SCDB::id(., conn))
DBI::dbRemoveTable(conn, .)
}
expect_false(DBI::dbExistsTable(conn, .))
})
Expand Down

0 comments on commit 0208318

Please sign in to comment.