Skip to content

Commit 8c485d1

Browse files
committed
tests: remove skipped tests, adapt commented code for other_keys
1 parent ea28a15 commit 8c485d1

File tree

3 files changed

+2
-42
lines changed

3 files changed

+2
-42
lines changed

tests/testthat/test-epi_df.R

-18
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,6 @@ test_that("new_epi_df works as intended", {
2323
expect_true(lubridate::is.POSIXt(attributes(epi_tib)$metadata$as_of))
2424
})
2525

26-
test_that("as_epi_df errors when additional_metadata is not a list", {
27-
skip("additional_metadata is no longer an argument, not tested")
28-
# This is the 3rd example from as_epi_df
29-
ex_input <- jhu_csse_county_level_subset %>%
30-
dplyr::filter(time_value > "2021-12-01", state_name == "Massachusetts") %>%
31-
dplyr::slice_tail(n = 6) %>%
32-
tsibble::as_tsibble() %>%
33-
dplyr::mutate(
34-
state = rep("MA", 6),
35-
pol = rep(c("blue", "swing", "swing"), each = 2)
36-
)
37-
38-
expect_error(
39-
as_epi_df(ex_input, additional_metadata = c(other_keys = "state", "pol")),
40-
"Must be of type 'list', not 'character'."
41-
)
42-
})
43-
4426
test_that("as_epi_df errors for non-character other_keys", {
4527
ex_input <- jhu_csse_county_level_subset %>%
4628
dplyr::filter(time_value > "2021-12-01", state_name == "Massachusetts") %>%

tests/testthat/test-epix_merge.R

-22
Original file line numberDiff line numberDiff line change
@@ -177,28 +177,6 @@ test_that("epix_merge forbids and warns on metadata and naming issues", {
177177
),
178178
regexp = "overlapping.*names"
179179
)
180-
181-
skip("Additional metadata is no longer used, not tested.")
182-
expect_warning(
183-
epix_merge(
184-
as_epi_archive(tibble::tibble(geo_value = "ak", time_value = test_date, version = test_date + 1L, x_value = 1L),
185-
additional_metadata = list("updates_fetched" = lubridate::ymd_hms("2022-05-01 16:00:00", tz = "UTC"))
186-
),
187-
as_epi_archive(tibble::tibble(geo_value = "ak", time_value = test_date, version = test_date + 1L, y_value = 2L))
188-
),
189-
regexp = "x\\$additional_metadata",
190-
class = "epiprocess__epix_merge_ignores_additional_metadata"
191-
)
192-
expect_warning(
193-
epix_merge(
194-
as_epi_archive(tibble::tibble(geo_value = "ak", time_value = test_date, version = test_date + 1L, x_value = 1L)),
195-
as_epi_archive(tibble::tibble(geo_value = "ak", time_value = test_date, version = test_date + 1L, y_value = 2L),
196-
additional_metadata = list("updates_fetched" = lubridate::ymd_hms("2022-05-01 16:00:00", tz = "UTC"))
197-
)
198-
),
199-
regexp = "y\\$additional_metadata",
200-
class = "epiprocess__epix_merge_ignores_additional_metadata"
201-
)
202180
})
203181

204182
# use `local` to prevent accidentally using the x, y, xy bindings here

tests/testthat/test-grouped_epi_archive.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ test_that("Grouping, regrouping, and ungrouping archives works as intended", {
7272
# #
7373
# as_epi_df(geo_type = "nation", # bug; want "custom" from NA; issue #242
7474
# as_of = as.Date("2000-01-03"),
75-
# additional_metadata = list(other_keys = "age_group")) %>%
75+
# other_keys = "age_group") %>%
7676
# # put back in expected order; see issue #166:
7777
# select(age_group, geo_value, time_value, s) %>%
7878
# nolint end
@@ -94,7 +94,7 @@ test_that("Grouping, regrouping, and ungrouping archives works as intended", {
9494
time_value = as.Date(time_value)
9595
) %>%
9696
# as_epi_df(as_of = as.Date("2000-01-03"),
97-
# additional_metadata = list(other_keys = "age_group")) %>%
97+
# other_keys = "age_group") %>%
9898
# # put back in expected order; see issue #166:
9999
# select(geo_value, age_group, time_value, s) %>%
100100
group_by(geo_value, age_group, .drop = FALSE)

0 commit comments

Comments
 (0)