Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/testthat/test-get_pvol.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ test_that("multiple timestamps and radars work", {

test_that("Mixed radar vector (single timestamp)", {
skip_if_offline()
skip_if_not_installed("vol2birdR", "1.3.0")
time_utc <- lubridate::as_datetime("2021-01-20 05:01:00")
suppressMessages(pvols <- getRad::get_pvol(c("KABR", "finur"), time_utc))
expect_true(is.list(pvols))
Expand All @@ -152,6 +153,8 @@ test_that("Mixed radar vector (single timestamp)", {

test_that("Mixed radar vector + 9 minute interval", {
skip_if_offline()
skip_if_not_installed("vol2birdR", "1.3.0")

time_utc <- lubridate::as_datetime("2025-01-20 03:55:50")
dt_int <- lubridate::interval(time_utc, time_utc + lubridate::minutes(9))
suppressMessages(pvols <- getRad::get_pvol(c("KABR", "fikan"), dt_int))
Expand Down
9 changes: 6 additions & 3 deletions tests/testthat/test-get_pvol_at.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("Pvol for hochficht in austria can be downloaded", {
skip_if_offline("public.hub.geosphere.at")
skip_if_offline(host = "public.hub.geosphere.at")
time <- as.POSIXct(Sys.time() - 10000, tz = "Europe/Helsinki")
pvol <- expect_s3_class(get_pvol("hochficht", time, param = "all"), "pvol")
expect_true(bioRad::is.pvol(pvol))
Expand All @@ -10,7 +10,7 @@ test_that("Pvol for hochficht in austria can be downloaded", {
})

test_that("Pvol for hochficht in austria can be downloaded", {
skip_if_offline("public.hub.geosphere.at")
skip_if_offline(host = "public.hub.geosphere.at")
time <- as.POSIXct(
Sys.time() - 10000 - 24 * 3 * 60 * 60,
tz = "Europe/Helsinki"
Expand All @@ -21,7 +21,10 @@ test_that("Pvol for hochficht in austria can be downloaded", {
)
})
test_that("hochficht can be combined with other radars", {
skip_if_offline("public.hub.geosphere.at")
skip_if_offline(host = "public.hub.geosphere.at")
skip_if_offline(host = "unidata-nexrad-level2.s3.amazonaws.com")
skip_if_offline(host = "opendata.dwd.de")
skip_if_not_installed("vol2birdR", "1.3.0")
suppressMessages(expect_type(
pvol_lst <- get_pvol(
c("depro", "hochficht", "KABX"),
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-get_pvol_us.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ dt_int <- lubridate::interval(time_utc, time_utc + lubridate::minutes(9))

test_that("NEXRAD polar volume can be downloaded", {
skip_if_offline(host = "unidata-nexrad-level2.s3.amazonaws.com")
skip_if_not_installed("vol2birdR", "1.3.0")

suppressMessages(
expect_s3_class(
getRad::get_pvol("KABR", time_utc),
Expand All @@ -24,6 +26,8 @@ test_that("pvol us internal functions", {

test_that("NEXRAD polar volume correct time is downloaded", {
skip_if_offline(host = "unidata-nexrad-level2.s3.amazonaws.com")
skip_if_not_installed("vol2birdR", "1.3.0")

t <- as.POSIXct("2025-1-10 18:00:00", tz = "UTC")
suppressMessages(expect_identical(
getRad::get_pvol("KABX", t)$datetime,
Expand Down
Loading