tests/testthat/test-setHvdcAreas.R

context("setHvdcAreas")

#misc

sapply(studyPathS, function(studyPath){
  
  
  opts <- setSimulationPath(studyPath)
  
  dt <- readAntares(areas = "all", links = "all", showProgress = FALSE)
  
  dt <- setHvdcAreas(dt, as.character(unique(dt$areas$area)[1]))
  
  expect_true(attributes(dt$areas)$hvdcAreas ==  as.character(unique(dt$areas$area)[1]))
  
  dtar <- setHvdcAreas(dt$areas, as.character(unique(dt$areas$area)[1]))
  expect_true(attributes(dtar)$hvdcAreas ==  as.character(unique(dt$areas$area)[1]))
  
  expect_error(setHvdcAreas(dt, 'unexist'))
  expect_error(setHvdcAreas(dt$links, 'unexist'))
  
  
})

Try the antaresRead package in your browser

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

antaresRead documentation built on Sept. 13, 2024, 1:12 a.m.