tests/testthat/test-request.R

# Offline tests for argument validation in axprism_request. The validation and
# method dispatch happen before any HTTP call, so these never reach the network.

test_that("axprism_request requires an axprism_client", {
  expect_error(
    axprism_request("not-a-client", "GET", "/api/v1/health"),
    "inherits"
  )
})

test_that("axprism_request rejects unsupported HTTP methods", {
  client <- axprism_client(api_key = "demo-key")
  expect_error(
    axprism_request(client, "PATCH", "/api/v1/health"),
    "unsupported method"
  )
})

Try the axprism package in your browser

Any scripts or data that you put into this service are public.

axprism documentation built on July 8, 2026, 9:07 a.m.