inst/tinytest/test-cl-auth-backend.R

# Test AuthBackend class

expect_error(RestRserve:::AuthBackend$new())

# Test empty object
f = function() TRUE
prefix = "my-prefix"
obj = RestRserve:::AuthBackend$new(
  FUN = f,
  auth_header_prefix = prefix
)
expect_true(inherits(obj, "AuthBackend"))
expect_error(obj$authenticate(), "not implemented")
expect_equal(obj$.__enclos_env__$private$auth_fun, f)
expect_equal(obj$.__enclos_env__$private$auth_header_prefix, prefix)
expect_true(inherits(obj$HTTPError, "HTTPError"))

Try the RestRserve package in your browser

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

RestRserve documentation built on Sept. 12, 2022, 9:06 a.m.