Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove httptest2 API mocking infrastructure #67

Merged
merged 4 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Suggests:
covr,
ggplot2,
glue,
httptest2,
knitr,
rmarkdown,
testthat (>= 3.0.0),
Expand Down
4 changes: 2 additions & 2 deletions R/parse_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ parse_params <- function(station_id, start, end, hour = FALSE) {
}
#If daily
} else {
if (!is.null(start) & start_parsed >= lubridate::today()) {
if (!is.null(start) & start_parsed >= lubridate::today(tzone = tz)) {
stop("Please supply a `start_date` earlier than today.")
}
if (!is.null(end) & end_parsed >= lubridate::today()) {
if (!is.null(end) & end_parsed >= lubridate::today(tzone = tz)) {
stop("Please supply an `end_date` earlier than today.")
}
if(end_parsed < start_parsed) {
Expand Down
18 changes: 10 additions & 8 deletions inst/httptest/redact.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#shortens file paths created by httptest2 so that R CMD check doesn't complain
httptest2::set_redactor(
function (resp) {
resp %>%
httptest2::gsub_response("api.azmet.arizona.edu/v1/observations/", "") %>%
httptest2::gsub_response("\\*", "default") #asterix is not valid dir name on all OS
}
)
## httptest2 isn't currently used, but if it is used for API mocking in the future, this will be helpful

##shortens file paths created by httptest2 so that R CMD check doesn't complain
# httptest2::set_redactor(
# function (resp) {
# resp %>%
# httptest2::gsub_response("api.azmet.arizona.edu/v1/observations/", "") %>%
# httptest2::gsub_response("\\*", "default") #asterix is not valid dir name on all OS
# }
# )
244 changes: 0 additions & 244 deletions tests/testthat/add_units_mocks/daily/az01/2023-11-27T00-00/P2D.json

This file was deleted.

Loading