File: test-resp-status.R

package info (click to toggle)
r-cran-httr2 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,604 kB
  • sloc: sh: 21; makefile: 2
file content (7 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
test_that("get some useful output from WWW-Authenticate header", {
  resp <- response(401, headers = 'WWW-Authenticate: Bearer realm="example",error="invalid_token",error_description="The access token expired"')
  expect_snapshot_error(resp_check_status(resp))

resp <- response(403, headers = 'WWW-Authenticate: Bearer realm="https://accounts.google.com/", error="insufficient_scope", scope="https://www.googleapis.com/auth/iam https://www.googleapis.com/auth/cloud-platform"')
  expect_snapshot_error(resp_check_status(resp))
})