Skip to content

Commit

Permalink
fix rate limit header testing check skip
Browse files Browse the repository at this point in the history
  • Loading branch information
russbiggs committed Feb 1, 2025
1 parent 3501e76 commit 5eb54c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions tests/testthat/test-shared.R
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,11 @@ test_that("add_headers correctly adds headers", {
)
results <- list(a = "b")
results <- add_headers(results, res)
expect_equal(attr(results, "x_ratelimit_used"), 42)
expect_equal(attr(results, "x_ratelimit_reset"), 43)
expect_equal(attr(results, "x_ratelimit_limit"), 44)
expect_equal(attr(results, "x_ratelimit_remaining"), 45)
headers <- attr(results, "headers")
print("HEADERS")
print(headers)
expect_equal(headers[["x_ratelimit_used"]], 42)
expect_equal(headers[["x_ratelimit_reset"]], 43)
expect_equal(headers[["x_ratelimit_limit"]], 44)
expect_equal(headers[["x_ratelimit_remaining"]], 45)
})
2 changes: 1 addition & 1 deletion vignettes/openaq.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ locations <- list_locations(
providers_id = 166
)
headers <- attr(locations, "headers")
print(headers$x_ratelimit_remaining)
print(headers[["x_ratelimit_remaining"]])
# > 59
```
Expand Down

0 comments on commit 5eb54c5

Please sign in to comment.