From 713dc52ac400e7e17844a3fc9ff66d03bb6492a0 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Mon, 21 Oct 2024 15:46:19 +0100 Subject: [PATCH] Add test of verification not adding location --- tests/testthat/test-location.R | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/testthat/test-location.R b/tests/testthat/test-location.R index 5f80ba3d..f4179f85 100644 --- a/tests/testthat/test-location.R +++ b/tests/testthat/test-location.R @@ -1195,3 +1195,18 @@ test_that("be chatty when pulling packets", { expect_match(res$messages[[2]], "Found 3 packets at 'server', of which 1 is new") }) + + +test_that("verify location on addition", { + root <- create_temporary_root() + path <- tempfile() + + expect_error( + orderly_location_add_path("upstream", path = path, root = root)) + expect_equal(orderly_location_list(root = root), "local") + + expect_no_error( + orderly_location_add_path("upstream", path = path, verify = FALSE, + root = root)) + expect_equal(orderly_location_list(root = root), c("local", "upstream")) +})