Error in `httr2::resp_body_json(response)`: Unexpected content type "NA".
* Expecting type "application/json" or suffix "json".

test_that("`landfireAPIv2()` recognizes argument errors", {
landfireAPIv2(aoi = aoi, email = email),
"argument `products` is missing with no default"
"argument `aoi` is missing with no default"
'argument "email" is missing, with no default'
"argument `products` must be a character vector"
"argument `aoi` must be a character or numeric vector"
landfireAPIv2(products, aoi, email = "notanemail"),
landfireAPIv2(products, aoi = 100, email = email, path = path),
"argument `aoi` must be between 1 and 79.*"
"argument `aoi` must be latitude and longitude.*"
"argument `aoi` must be ordered `xmin`, `ymin`, `xmax`, `ymax`"
"argument `aoi` must be vector of coordinates.*"
"argument `resolution` must be between 30 and 9999 or `NULL`"
"`edit_rule` operator classes must only be .*"
"`edit_rule` conditional operators must be one of .*"
# Returns error if `edit_mask` but no edit_rule
"`edit_mask` requires `edit_rule` to be specified."
test_that("`landfireAPIv2()` returns errors with email/priority_code", {
# ID errors with LFPSv1 requests with positional arguments
landfireAPIv2(products, aoi, projection, path = path),
"argument `priority_code` must be a character string"
test_that("`landfireAPIv2()` formats priority requests correctly", {
output <- landfireAPIv2(products, aoi, email,
test_that("`landfireAPIv2()` returns expected messages", {
landfireAPIv2(products, aoi, email, background = TRUE),
"`path` is missing. Files will be saved in temporary directory: .*"
# Return correct message with background jobs
test_that("`landfireAPIv2()` recognizes failed call", {
landfireAPIv2(products, aoi, email, projection, path = path),
"Job .* has failed with:\n\t.*\nPlease check the LFPS",
"API documentation for more information."
# Resets resolution to NULL when user sets resolution = 30
result <- landfireAPIv2(products, aoi, email,
test_that("`landfireAPIv2()` works with `getAOI()`", {
test_that("`landfireAPIv2()` works with `getZone()`", {
zone <- getZone("Northern California Coastal Range")
test_that("`.post_request` catches file issues", {
"`edit_mask` file must be a zipped shapefile (.zip)",
writeBin(raw(1024 * 1024 + 1), tmp_file)
"`edit_mask` file exceeds maximum allowable size (1MB)",
"`edit_mask` file does not contain a shapefile"
test_that("`.post_editmask` returns expected response", {
test_that("`.fmt_editrules` correctly formats requests", {
# Single condition with multiple changes (Pulled from documentation)
# Multiple conditions with OR (Pulled from documentation)
# Single `edit_mask` with simple edit rules