Skip to content

Commit

Permalink
chore: update tests to reflect changed default argument in get_src_tb…
Browse files Browse the repository at this point in the history
…l_names()
  • Loading branch information
owenjonesuob authored and krlmlr committed Aug 14, 2024
1 parent d34dc70 commit a1119ed
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/testthat/test-db-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ test_that("DB helpers work for MSSQL", {
DBI::Id(catalog = "db_helpers_db", schema = "schema_db_helpers_2", table = "test_db_helpers_4")
)
expect_identical(
get_src_tbl_names(my_test_src(), schema = c("dbo", "schema_db_helpers"))[["dbo.test_db_helpers_2"]],
get_src_tbl_names(my_test_src(), schema = c("dbo", "schema_db_helpers"), names_pattern = "{.schema}.{.table}")[["dbo.test_db_helpers_2"]],
DBI::Id(schema = "dbo", table = "test_db_helpers_2")
)
expect_identical(
get_src_tbl_names(my_test_src(), schema = c("dbo", "schema_db_helpers"))[["schema_db_helpers.test_db_helpers_2"]],
get_src_tbl_names(my_test_src(), schema = c("dbo", "schema_db_helpers"), names_pattern = "{.schema}.{.table}")[["schema_db_helpers.test_db_helpers_2"]],
DBI::Id(schema = "schema_db_helpers", table = "test_db_helpers_2")
)
expect_warning(
out <- get_src_tbl_names(my_test_src(), schema = c("dbo", "schema_db_helpers"), names = "{.table}")["test_db_helpers_2"],
out <- get_src_tbl_names(my_test_src(), schema = c("dbo", "schema_db_helpers"), names_pattern = "{.table}")["test_db_helpers_2"],
'Local name test_db_helpers_2 will refer to <"dbo"."test_db_helpers_2">, rather than to <"schema_db_helpers"."test_db_helpers_2">',
fixed = TRUE
)
Expand All @@ -90,7 +90,7 @@ test_that("DB helpers work for MSSQL", {
))
)
expect_warning(
out <- get_src_tbl_names(my_test_src(), schema = c("schema_db_helpers", "dbo"), names = "{.table}")["test_db_helpers_2"],
out <- get_src_tbl_names(my_test_src(), schema = c("schema_db_helpers", "dbo"), names_pattern = "{.table}")["test_db_helpers_2"],
'Local name test_db_helpers_2 will refer to <"schema_db_helpers"."test_db_helpers_2">, rather than to <"dbo"."test_db_helpers_2">',
fixed = TRUE
)
Expand Down Expand Up @@ -145,15 +145,15 @@ test_that("DB helpers work for Postgres", {
DBI::Id(schema = "schema_db_helpers", table = "test_db_helpers_2")
)
expect_identical(
get_src_tbl_names(my_test_src(), schema = c("public", "schema_db_helpers"))["public.test_db_helpers_2"][[1]],
get_src_tbl_names(my_test_src(), schema = c("public", "schema_db_helpers"), names_pattern = "{.schema}.{.table}")["public.test_db_helpers_2"][[1]],
DBI::Id(schema = "public", table = "test_db_helpers_2")
)
expect_identical(
get_src_tbl_names(my_test_src(), schema = c("public", "schema_db_helpers"))["schema_db_helpers.test_db_helpers_2"][[1]],
get_src_tbl_names(my_test_src(), schema = c("public", "schema_db_helpers"), names_pattern = "{.schema}.{.table}")["schema_db_helpers.test_db_helpers_2"][[1]],
DBI::Id(schema = "schema_db_helpers", table = "test_db_helpers_2")
)
expect_warning(
out <- get_src_tbl_names(my_test_src(), schema = c("public", "schema_db_helpers"), names = "{.table}")["test_db_helpers_2"],
out <- get_src_tbl_names(my_test_src(), schema = c("public", "schema_db_helpers"), names_pattern = "{.table}")["test_db_helpers_2"],
'Local name test_db_helpers_2 will refer to <"public"."test_db_helpers_2">, rather than to <"schema_db_helpers"."test_db_helpers_2">',
fixed = TRUE
)
Expand All @@ -165,7 +165,7 @@ test_that("DB helpers work for Postgres", {
))
)
expect_warning(
out <- get_src_tbl_names(my_test_src(), schema = c("schema_db_helpers", "public"), names = "{.table}")["test_db_helpers_2"],
out <- get_src_tbl_names(my_test_src(), schema = c("schema_db_helpers", "public"), names_pattern = "{.table}")["test_db_helpers_2"],
'Local name test_db_helpers_2 will refer to <"schema_db_helpers"."test_db_helpers_2">, rather than to <"public"."test_db_helpers_2">',
fixed = TRUE
)
Expand Down

0 comments on commit a1119ed

Please sign in to comment.