Browse Source

added tests for conditions identified in #19

pull/20/head
boB Rudis 2 years ago
parent
commit
dc7f1df791
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
4 changed files with 10 additions and 2 deletions
  1. +0
    -1
      NAMESPACE
  2. +2
    -0
      NEWS.md
  3. +1
    -1
      man/cdcfluview.Rd
  4. +7
    -0
      tests/testthat/test-cdcfluview.R

+ 0
- 1
NAMESPACE View File

@ -29,7 +29,6 @@ importFrom(dplyr,filter)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(jsonlite,fromJSON)
importFrom(lubridate,epiweek)
importFrom(purrr,discard)
importFrom(purrr,keep)
importFrom(purrr,map)


+ 2
- 0
NEWS.md View File

@ -1,6 +1,8 @@
# cdcfluview 0.9.0
- fix bug in epiweek computation in ilinet() thanks to a bug report by @jturtle (#19)
- included cloc metrics and refreshed README
-
# cdcfluview 0.7.0


+ 1
- 1
man/cdcfluview.Rd View File

@ -4,7 +4,7 @@
\name{cdcfluview}
\alias{cdcfluview}
\alias{cdcfluview-package}
\title{Retrieve 'U.S'.' Flu Season Data from the 'CDC' 'FluView' Portal}
\title{Retrieve Flu Season Data from the United States Centers for Disease Control and Prevention ('CDC') 'FluView' Portal}
\description{
The U.S. Centers for Disease Control (CDC) maintains a portal
\url{http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html} for


+ 7
- 0
tests/testthat/test-cdcfluview.R View File

@ -16,6 +16,13 @@ test_that("New API works", {
skip_on_cran()
nat_dat <- ilinet(region="national", years=1997:2018)
expect_equal(unique(diff(nat_dat$week_start)), 7)
expect_equal(
as.character(unique(lubridate::wday(unique(nat_dat$week_start), label=TRUE))),
"Sun"
)
expect_that(ilinet("national", years=2017), is_a("data.frame"))
expect_that(ilinet("hhs", years=2017), is_a("data.frame"))
expect_that(ilinet("census", years=2017), is_a("data.frame"))


Loading…
Cancel
Save