Skip to content

Commit dd02fea

Browse files
committed
0 errors, 0 warnings with a few modifications
1 parent ba3e804 commit dd02fea

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/testthat/test-archive.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ test_that("epi_archives are correctly instantiated with a variety of data types"
7373
key = "code")
7474

7575
ea5 <- as_epi_archive(kdt)
76-
expect_equal(key(ea5$DT),c("geo_value","time_value","version")) # Key from data.table isn't absorbed
76+
# Key from data.table isn't absorbed when as_epi_archive is used
77+
expect_equal(key(ea5$DT),c("geo_value","time_value","version"))
7778
expect_equal(ea5$additional_metadata,list())
7879

79-
ea6 <- as_epi_archive(kdt,other_keys="code",additional_metadata=list(value=df$value))
80-
expect_equal(key(ea6$DT),c("geo_value","time_value","code","version"))
80+
ea6 <- as_epi_archive(kdt,other_keys="value",additional_metadata=list(value=df$value))
81+
# Mismatched keys, but the one from as_epi_archive overrides
82+
expect_equal(key(ea6$DT),c("geo_value","time_value","value","version"))
8183
expect_equal(ea6$additional_metadata,list(value=df$value))
8284

8385
# Unkeyed data.table
@@ -95,7 +97,7 @@ test_that("epi_archives are correctly instantiated with a variety of data types"
9597
expect_equal(key(ea8$DT),c("geo_value","time_value","code","version"))
9698
expect_equal(ea8$additional_metadata,list(value=df$value))
9799

98-
#epi_df
100+
# epi_df
99101
edf <- jhu_csse_daily_subset %>%
100102
select(geo_value,time_value,cases) %>%
101103
mutate(version = max(time_value), code = "USA")

0 commit comments

Comments
 (0)