tests/testthat/test-satInfo.R

# devtools::test(".", "satInfo")
context("satInfo")

test_that("satAddLog works as expected for Landsat 8", {
  path <- system.file("testdata/LC8", 
                      package = "satellite")
  files <- list.files(path, 
                      pattern = glob2rx("LC8*.TIF"), 
                      full.names = TRUE)
  sat <- satellite(files)
  
  sat <- addSatLog(sat)
  sat <- addSatLog(sat)
  expect_equal(length(getSatLog(sat)), 3)
  expect_equal(names(getSatLog(sat)[3]), "ps0003")
  
  #   sort( sapply(mget(ls()),object.size) )
  #   print(object.size(x=lapply(ls(), get)), units="Mb")
  
})

Try the satellite package in your browser

Any scripts or data that you put into this service are public.

satellite documentation built on Oct. 12, 2021, 5:07 p.m.