Skip to content

Commit

Permalink
smaller requests
Browse files Browse the repository at this point in the history
  • Loading branch information
khufkens committed Aug 21, 2024
1 parent 618187c commit eef64b4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
27 changes: 13 additions & 14 deletions tests/testthat/test_ds.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cds_request <- list(
time = "13:00",
pressure_level = "1000",
data_format = "grib",
area = c(70, -20, 60, 30),
area = c(51, 1, 50, 2),
target = "download.grib"
)

Expand All @@ -40,7 +40,7 @@ cds_request_faulty <- list(
time = "13:00",
pressure_level = "1000",
data_format = "grib",
area = c(70, -20, 60, 30),
area = c(51, 1, 50, 2),
target = "download.grib"
)

Expand Down Expand Up @@ -194,18 +194,17 @@ test_that("batch request tests", {
years <- c(2017,2018)
requests <- lapply(years, function(y) {
list(
"dataset_short_name" = "reanalysis-era5-pressure-levels",
"product_type" = "reanalysis",
"format" = "netcdf",
"variable" = "temperature",
"pressure_level" = "850",
"year" = y,
"month" = "05",
"day" = "04",
"time" = "00:00",
"area" = "50/9/51/10",
"format" = "netcdf",
"target" = paste0(y, "-era5-demo.nc"))
dataset_short_name = "reanalysis-era5-pressure-levels",
product_type = "reanalysis",
variable = "geopotential",
year = "2024",
month = "03",
day = "01",
time = "13:00",
pressure_level = "1000",
data_format = "grib",
area = c(51, 1, 50, 2),
target = paste0(y, "-era5-demo.grib"))
})

expect_output(
Expand Down
19 changes: 9 additions & 10 deletions tests/testthat/test_helper_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ test_that("create tests archetype", {
my_request <- list(
dataset_short_name = "reanalysis-era5-pressure-levels",
product_type = "reanalysis",
variable = "temperature",
year = "2000",
month = "04",
day = "04",
time = "00:00",
pressure_level = "850",
data_format = "netcdf",
download_format = "unarchived",
area = c(70, -20, 60, 30),
target = "TMPFILE"
variable = "geopotential",
year = "2024",
month = "03",
day = "01",
time = "13:00",
pressure_level = "1000",
data_format = "grib",
area = c(51, 1, 50, 2),
target = "download.grib"
)

# create archetype
Expand Down

0 comments on commit eef64b4

Please sign in to comment.