Skip to content

Commit

Permalink
update mocked bindings for Databricks config tests (#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch authored Dec 9, 2024
1 parent f4f65bb commit 629595a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test-driver-databricks.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ test_that("supports OAuth M2M in env var", {
test_that("dbConnect method handles httpPath aliases (#787)", {
local_mocked_bindings(
databricks_args = function(...) stop("made it"),
configure_spark = function(...) TRUE
configure_simba = function(...) TRUE
)

expect_error(dbConnect(databricks(), HTTPPath = "boop"), "made it")
expect_error(dbConnect(databricks(), httpPath = "boop"), "made it")
})

test_that("dbConnect method errors informatively re: httpPath (#787)", {
local_mocked_bindings(configure_spark = function(...) TRUE)
local_mocked_bindings(configure_simba = function(...) TRUE)

expect_snapshot(
error = TRUE,
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,10 @@ test_that("configure_simba() calls configure_unixodbc_simba() (#835)", {
skip_if_not(is_macos())
local_mocked_bindings(
locate_install_unixodbc = function() "hey",
locate_config_spark = function() "there",
configure_unixodbc_simba = function(...) TRUE
)

expect_true(configure_simba())
expect_true(configure_simba(list(path = "example")))
})

test_that("locate_install_unixodbc() returns reasonable values", {
Expand Down

0 comments on commit 629595a

Please sign in to comment.