Error in `value[[3L]](cond)`: Failed to retrieve capabilities after 3 attempts: Internal Server Error (HTTP 500).

library(Argentum)  # Replace with your actual package name
# Test the argentum_get_capabilities function
mock_get_success <- function(url, ...) {
mock_get_failure <- function(url, ...) {
assign("httr::GET", mock_get_success, envir = .GlobalEnv)
# Test successful retrieval of capabilities
assign("httr::GET", mock_get_failure, envir = .GlobalEnv)
expect_error(argentum_get_capabilities(url, max_tries = 2), "Failed to retrieve capabilities after 2 attempts")

"Failed to retrieve capabilities after 2 attempts"

<packageNotFoundError/error/condition>
Error in `loadNamespace(x)`: there is no package called 'mockery'

test_that("argentum_import_wfs_layer constructs correct URL", {
test_that("argentum_import_wfs_layer handles URL with existing parameters", {
mockery::stub(argentum_import_wfs_layer, "sf::read_sf", function(url) stop("Test error"))
expect_error(argentum_import_wfs_layer("http://test.com/wfs", "TestLayer"), "Error importing WFS layer: Test error")

"argentum_import_wfs_layer handles URL with existing parameters"

argentum_import_wfs_layer handles URL with existing parameters

test_that("argentum_interactive_import handles successful import", {
mock_orgs <- data.frame(Name = "Test Org", WFS_URL = "http://test.com/wfs", stringsAsFactors = FALSE)
mock_layers <- data.frame(Name = "TestLayer", Title = "Test Layer", stringsAsFactors = FALSE)
mock_sf <- structure(list(), class = "sf")
test_that("argentum_interactive_import handles invalid organization selection", {
test_that("argentum_interactive_import handles no layers", {
mock_layers <- data.frame(Name = character(0), Title = character(0), stringsAsFactors = FALSE)
test_that("argentum_interactive_import handles invalid layer selection", {

"argentum_interactive_import handles invalid organization selection"
"argentum_interactive_import handles invalid layer selection"

argentum_interactive_import handles invalid organization selection

argentum_interactive_import handles invalid layer selection