Skip to content

Commit

Permalink
Add test of loading driver
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Mar 5, 2024
1 parent 6695c31 commit 7ca69c1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/testthat/test-location.R
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,18 @@ test_that("validate arguments to packit locations", {
test_that("can add a packit location", {
root <- create_temporary_root()
orderly_location_add("other", "packit",
list(url = "example.com", token = "abc123"),
list(url = "https://example.com", token = "abc123"),
root = root)
expect_equal(orderly_location_list(root = root), c("local", "other"))
dr <- location_driver("other", root)
expect_s3_class(dr, "orderly_location_http") # not actually packit
cl <- dr$.__enclos_env__$private$client
expect_equal(cl$url, "https://example.com/packit/api/outpack")
expect_equal(
cl$auth,
list(enabled = TRUE,
url = "https://example.com/packit/api/auth/login/api",
data = list(token = scalar("abc123"))))
})


Expand Down

0 comments on commit 7ca69c1

Please sign in to comment.