Skip to content

Commit

Permalink
Fix test due to my last minute addition of count=no to legacy WQP
Browse files Browse the repository at this point in the history
  • Loading branch information
ldecicco-USGS committed Nov 5, 2024
1 parent 20fa9e7 commit 8f93afe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
29 changes: 2 additions & 27 deletions tests/testthat/tests_general.R
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ test_that("readWQPdots working", {

# NWIS names (stateCd) converted to WQP expected names (statecode)
formArgs <- dataRetrieval:::readWQPdots(stateCd = "OH", parameterCd = "00665")
expect_true(length(formArgs$values) == 3)
expect_true(length(formArgs$values) == 4)
expect_true("statecode" %in% names(formArgs$values))
expect_false("stateCd" %in% names(formArgs$values))

Expand Down Expand Up @@ -557,18 +557,6 @@ test_that("profiles", {
"OrganizationFormalName"
) %in% names(samp_activity)))

# # Data profile: "Sampling Activity Metrics"
# act_metrics <- readWQPdata(
# statecode = "WI",
# countycode = "Dane",
# service = "ActivityMetric"
# )
#
# expect_true(all(c(
# "OrganizationIdentifier",
# "OrganizationFormalName"
# ) %in% names(act_metrics)))

# Data profile: "Result Detection Quantitation Limit Data"
dl_data <- readWQPdata(
siteid = "USGS-04024315",
Expand Down Expand Up @@ -634,27 +622,14 @@ test_that("readWQPsummary", {
# nolint start: line_length_linter
expect_equal(
attr(site1, "url"),
"https://www.waterqualitydata.us/data/summary/monitoringLocation/search?siteid=USGS-07144100&summaryYears=5&mimeType=csv&dataProfile=periodOfRecord"
"https://www.waterqualitydata.us/data/summary/monitoringLocation/search?siteid=USGS-07144100&summaryYears=5&mimeType=csv&count=no&dataProfile=periodOfRecord"
)
# nolint end
})

test_that("importWQP convertType", {
testthat::skip_on_cran()

# rawSampleURL_NoZip <- constructWQPURL("USGS-01594440", "01075", "", "")
# rawSampleURL_NoZip_char <- importWQP(rawSampleURL_NoZip, convertType = FALSE)
# expect_is(rawSampleURL_NoZip_char$Result_Measure, "character")
#
# Put back in when services get more robust.
# phos <- readWQPdata(statecode = "WI", countycode = "Dane",
# characteristicName = "Phosphorus",
# startDateLo = "2022-06-01",
# startDateHi = "2022-09-01",
# convertType = FALSE,
# service = "ResultWQX")
# expect_is(phos$Result_Measure, "character")

SC <- readWQPqw(siteNumbers = "USGS-05288705", parameterCd = "00300",
convertType = FALSE, legacy = TRUE)
expect_is(SC$ResultMeasureValue, "character")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/tests_userFriendly_fxns.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ test_that("peak, rating curves, surface-water measurements", {
expect_equal(nrow(whatNWISdata(siteNumber = "10312000", parameterCd = "50286")), 0)
expect_equal(ncol(whatNWISdata(siteNumber = "10312000", parameterCd = "50286")), 24)

url <- "https://waterservices.usgs.gov/nwis/site/?format=rdb&seriesCatalogOutput=true&sites=05114000"
url <- httr2::request("https://waterservices.usgs.gov/nwis/site/?format=rdb&seriesCatalogOutput=true&sites=05114000")
x <- importRDB1(url)

siteID <- "263819081585801"
Expand Down

0 comments on commit 8f93afe

Please sign in to comment.