From 7ca69c12ae2e843cc995dc735a20e12697cc600e Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Tue, 5 Mar 2024 16:23:39 +0000 Subject: [PATCH] Add test of loading driver --- tests/testthat/test-location.R | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-location.R b/tests/testthat/test-location.R index 6036dd6a..9f260cf4 100644 --- a/tests/testthat/test-location.R +++ b/tests/testthat/test-location.R @@ -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")))) })