From cd9628ff2af7734fce4a7fe62a5115b9ef3dd78c Mon Sep 17 00:00:00 2001 From: cristinamullin <46969696+cristinamullin@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:09:31 -0500 Subject: [PATCH] update required cols and tests --- R/RequiredCols.R | 2 +- tests/testthat/test-DataDiscoveryRetrieval.R | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/R/RequiredCols.R b/R/RequiredCols.R index 0a3cf1b5..5ddfb367 100644 --- a/R/RequiredCols.R +++ b/R/RequiredCols.R @@ -199,7 +199,7 @@ extra.cols <- c( "ActivityEndDate", "ActivityEndTime.Time", "ActivityEndTime.TimeZoneCode", - "ActivityEndDateTime", # generated by USGS DR + "ActivityEndDateTime", # originally generated by USGS DR, # no longer in default dataRetrieval profile? 11/7/24 "ActivityConductingOrganizationText", "SampleAquifer", "ActivityLocation.LatitudeMeasure", diff --git a/tests/testthat/test-DataDiscoveryRetrieval.R b/tests/testthat/test-DataDiscoveryRetrieval.R index 6f7d3490..6e5ff307 100644 --- a/tests/testthat/test-DataDiscoveryRetrieval.R +++ b/tests/testthat/test-DataDiscoveryRetrieval.R @@ -88,10 +88,7 @@ test_that("TADA_DataRetrieval", { "LabSamplePreparationUrl", "LastUpdated", "ProviderName", - # "timeZoneStart", - # "timeZoneEnd", "ActivityStartDateTime", - "ActivityEndDateTime", "MonitoringLocationTypeName", "MonitoringLocationDescriptionText", "HUCEightDigitCode", @@ -220,10 +217,7 @@ test_that("TADA_DataRetrieval", { "LabSamplePreparationUrl", "LastUpdated", "ProviderName", - # "timeZoneStart", - # "timeZoneEnd", "ActivityStartDateTime", - "ActivityEndDateTime", "MonitoringLocationTypeName", "MonitoringLocationDescriptionText", "HUCEightDigitCode", @@ -263,11 +257,11 @@ test_that("TADA_DataRetrieval", { }) test_that("TADA_DataRetrieval", { - randomstate <- TADA_RandomTestingData() - # you could just pick the important columns: + randomstate2 <- TADA_RandomTestingData(number_of_days = 3, choose_random_state = TRUE) + expect_true(all( - Filter(function(x) !any(grepl("TADA.", x)), c(require.cols, last.cols) - ) %in% names(randomstate))) + Filter(function(x) !any(grepl("TADA.", x)), require.cols + ) %in% names(randomstate2))) }) test_that("TADA_DataRetrieval", { @@ -366,10 +360,7 @@ test_that("TADA_DataRetrieval", { "LabSamplePreparationUrl", "LastUpdated", "ProviderName", - #"timeZoneStart", - #"timeZoneEnd", "ActivityStartDateTime", - "ActivityEndDateTime", "MonitoringLocationTypeName", "MonitoringLocationDescriptionText", "HUCEightDigitCode",