Skip to content

Commit e99f4b6

Browse files
authored
Merge pull request #281 from cmu-delphi/1.2release
minor test fixes, NEWS, dev link borked
2 parents 626c30b + 3bad057 commit e99f4b6

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: epidatr
22
Type: Package
33
Title: Client for Delphi's 'Epidata' API
4-
Version: 1.1.5
4+
Version: 1.2.0
55
Authors@R:
66
c(
77
person("Logan", "Brooks", email = "[email protected]", role = c("aut")),

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Open a release issue and then copy and follow this checklist in the issue (modif
5353

5454
- [ ] `git pull` on `dev` branch.
5555
- [ ] Make sure all changes are committed and pushed.
56-
- [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_epiprocess.html).
56+
- [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_epidatr.html).
5757
- [ ] `devtools::check(".", manual = TRUE, env_vars = c(NOT_CRAN = "false"))`.
5858
- Aim for 10/10, no notes.
5959
- [ ] If check works well enough, merge to main. Otherwise open a PR to fix up.

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
- Improve handling of the `EPIDATR_USE_CACHE` environment variable, allowing it
66
to be any value convertable by `as.logical()` and handle the case when it
77
can't be converted.
8+
- Support more date formats in function to convert dates to epiweeks. Use `parse_api_date` since it already supports both common formats. #276
9+
- `EPIDATR_USE_CACHE` only supported exactly "TRUE" before. Now it supports all logical values and includes a warning when any value that can't be converted to logical is provided. #273
10+
- `missing` doesn't count default values as non-missing. If a user doesn't pass `geo_values` or `time_values` (both of which default to `"*"` in `pub_covidcast`), or `dates` (in `pub_covid_hosp_state_timeseries`), the missing check fails. To avoid this, just don't check missingness of those two arguments.
811

912
# epidatr 1.1.1
1013

tests/testthat/test-cache.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test_set_cache <- function(cache_dir = new_temp_dir,
1818
}
1919

2020
test_that("cache set as expected", {
21-
test_set_cache()
21+
expect_message(test_set_cache())
2222
if (grepl("/", as.character(new_temp_dir))) {
2323
# this is what check produces
2424
expect_equal(cache_info()$dir, normalizePath(new_temp_dir))
@@ -38,7 +38,7 @@ test_that("cache set as expected", {
3838

3939
# use an existing example to save, then load and compare the values
4040
test_that("cache saves & loads", {
41-
test_set_cache()
41+
expect_message(test_set_cache())
4242
epidata_call <- pub_covidcast(
4343
source = "jhu-csse",
4444
signals = "confirmed_7dav_incidence_prop",
@@ -128,7 +128,7 @@ test_that("check_is_cachable", {
128128
expect_false(check_is_cachable(epidata_call, fetch_args))
129129
}
130130
}
131-
test_set_cache()
131+
expect_message(test_set_cache())
132132
check_fun(expected_result = FALSE) # doesn't specify issues or as_of
133133
check_fun(as_of = "2020-01-01", expected_result = TRUE) # valid as_of
134134
check_fun(issues = "2020-01-01", expected_result = TRUE) # valid issues
@@ -178,14 +178,14 @@ test_that("check_is_cachable", {
178178
# cases where the cache isn't active
179179
disable_cache()
180180
check_fun(as_of = "2020-01-01", expected_result = FALSE)
181-
test_set_cache()
181+
expect_message(test_set_cache())
182182
cache_environ$epidatr_cache <- NULL
183183
check_fun(as_of = "2020-01-01", expected_result = FALSE)
184-
test_set_cache()
184+
expect_message(test_set_cache())
185185
check_fun(as_of = "2020-01-01", expected_result = TRUE)
186186
})
187187

188-
test_set_cache()
188+
expect_message(test_set_cache())
189189
cache_environ$epidatr_cache$prune()
190190
clear_cache(disable = TRUE)
191191
rm(new_temp_dir)

0 commit comments

Comments
 (0)