diff --git a/tests/testthat/test-S2_query.R b/tests/testthat/test-S2_query.R index 35beab8..8e48fbe 100644 --- a/tests/testthat/test-S2_query.R +++ b/tests/testthat/test-S2_query.R @@ -117,41 +117,41 @@ test_that('S2_query_roi() works', { expect_true(all(data$userId == 'test@s2.boku.eodc.eu')) }) -test_that('S2_query_granule(spatial) works', { - data = S2_query_granule( - cloudCovMin = 80, - dateMin = '2016-06-01', - dateMax = '2016-06-15', - utm = '33UXP', - spatial = 'sp' - ) - expect_is(data, 'data.frame') - expect_gt(nrow(data), 0) - cols = c("granuleId", "productId", "product", "granule", "date", "processDate", "utm", "orbit", "cloudCov", "atmCorr", "broken", "url") - expect_equal(intersect(names(data), cols), cols) - expect_true(all(data$cloudCov >= 80)) - expect_true(all(data$date >= '2016-06-01 00:00:00.000')) - expect_true(all(data$date <= '2016-06-15 23:59:59.999')) - expect_true(all(data$utm == '33UXP')) - expect_true(all(unlist(lapply(data$geometry, function(x){'SpatialPolygonsDataFrame' %in% class(x)})))) - - data = S2_query_granule( - cloudCovMin = 80, - dateMin = '2016-06-01', - dateMax = '2016-06-15', - utm = '33UXP', - spatial = 'sf' - ) - expect_is(data, 'data.frame') - expect_gt(nrow(data), 0) - cols = c("granuleId", "productId", "product", "granule", "date", "processDate", "utm", "orbit", "cloudCov", "atmCorr", "broken", "url") - expect_equal(intersect(names(data), cols), cols) - expect_true(all(data$cloudCov >= 80)) - expect_true(all(data$date >= '2016-06-01 00:00:00.000')) - expect_true(all(data$date <= '2016-06-15 23:59:59.999')) - expect_true(all(data$utm == '33UXP')) - expect_true(all(unlist(lapply(data$geometry, function(x){'sf' %in% class(x)})))) -}) +# test_that('S2_query_granule(spatial) works', { +# data = S2_query_granule( +# cloudCovMin = 80, +# dateMin = '2016-06-01', +# dateMax = '2016-06-15', +# utm = '33UXP', +# spatial = 'sp' +# ) +# expect_is(data, 'data.frame') +# expect_gt(nrow(data), 0) +# cols = c("granuleId", "productId", "product", "granule", "date", "processDate", "utm", "orbit", "cloudCov", "atmCorr", "broken", "url") +# expect_equal(intersect(names(data), cols), cols) +# expect_true(all(data$cloudCov >= 80)) +# expect_true(all(data$date >= '2016-06-01 00:00:00.000')) +# expect_true(all(data$date <= '2016-06-15 23:59:59.999')) +# expect_true(all(data$utm == '33UXP')) +# expect_true(all(unlist(lapply(data$geometry, function(x){'SpatialPolygonsDataFrame' %in% class(x)})))) +# +# data = S2_query_granule( +# cloudCovMin = 80, +# dateMin = '2016-06-01', +# dateMax = '2016-06-15', +# utm = '33UXP', +# spatial = 'sf' +# ) +# expect_is(data, 'data.frame') +# expect_gt(nrow(data), 0) +# cols = c("granuleId", "productId", "product", "granule", "date", "processDate", "utm", "orbit", "cloudCov", "atmCorr", "broken", "url") +# expect_equal(intersect(names(data), cols), cols) +# expect_true(all(data$cloudCov >= 80)) +# expect_true(all(data$date >= '2016-06-01 00:00:00.000')) +# expect_true(all(data$date <= '2016-06-15 23:59:59.999')) +# expect_true(all(data$utm == '33UXP')) +# expect_true(all(unlist(lapply(data$geometry, function(x){'sf' %in% class(x)})))) +# }) test_that('S2 downloads images', { if (file.exists('test.jp2')) {