Skip to content

Commit f8f6ca1

Browse files
fix tests
1 parent afa10d7 commit f8f6ca1

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

R/api_file_info.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,12 @@ NULL
333333
start_date[[1L]], end_date[[1L]]
334334
)
335335
}
336-
fi[dates_in_fi, ]
336+
# get the timeline
337+
timeline <- .fi_timeline(fi)
338+
# filter timeline by existing dates
339+
timeline <- timeline[dates_in_fi]
340+
# filter tiles by dates
341+
dplyr::filter(fi, .data[["date"]] %in% timeline)
337342
}
338343
#' @title Filter file_info for a set of dates
339344
#' @noRd
@@ -347,7 +352,7 @@ NULL
347352
miss_dates <- paste0("'", dates[!dates_in_fi], "'", collapse = ",")
348353
stop("date(s) ", miss_dates, " not found")
349354
}
350-
fi[.fi_timeline(fi) %in% dates, ]
355+
dplyr::filter(fi, .data[["date"]] %in% dates)
351356
}
352357
#' @title Read a block based in a file info
353358
#' @noRd

tests/testthat/test-cube-mpc.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ test_that("Creating Sentinel-1 RTC cubes from MPC", {
150150
rast_sar <- p[[1]]$shp
151151
expect_equal(.raster_nlayers(rast_sar), 1)
152152

153-
output_dir <- paste0(tempdir(), "/s1rtc_reg")
153+
output_dir <- paste0(tempdir(), "/s1rtc_reg_sar")
154154
if (!dir.exists(output_dir)) {
155155
dir.create(output_dir)
156156
}

tests/testthat/test-cube-terrascope.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ test_that("Creating WORLD-CEREAL-2021 cubes from TERRASCOPE",{
4848
},
4949
.default = NULL
5050
)
51-
testthat::skip_if(purrr::is_null(class_cube),
51+
testthat::skip_if(purrr::is_null(world_cereal_2021),
5252
message = "TERRASCOPE is not accessible")
5353

5454
# cut the 3 x 3 degree grid to match the MGRS tile 22LBL

0 commit comments

Comments
 (0)