Skip to content

Commit

Permalink
Merge pull request #67 from uace-azmet/remove-httptest2
Browse files Browse the repository at this point in the history
remove httptest2 API mocking infrastructure
  • Loading branch information
Aariq authored Dec 12, 2023
2 parents 5a08de0 + ffd1e57 commit e6ca1ae
Show file tree
Hide file tree
Showing 32 changed files with 290 additions and 11,625 deletions.
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

0 comments on commit e6ca1ae

Please sign in to comment.