tests/testthat/test-fillClusterDesc.R

context("Function .fillClusterDesc")

sapply(studyPathS, function(studyPath){

  opts <- setSimulationPath(studyPath)

  clusterDesc <- readClusterDesc()

  describe(".fillClusterDesc", {

    it("fill missing values with provided defaults", {
      .fillClusterDesc(clusterDesc, marginal.cost = 0, min.stable.power = 0)
      expect_false(any(is.na(clusterDesc$marginal.cost)))
      expect_false(any(is.na(clusterDesc$min.stable.power)))
    })

    it("creates columns if they are not present", {
      .fillClusterDesc(clusterDesc, fictiveCol = "ok !")
      expect_false(is.null(clusterDesc$fictiveCol))
      expect_true(all(clusterDesc$fictiveCol == "ok !"))
    })

  })

})

Try the antaresProcessing package in your browser

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

antaresProcessing documentation built on June 25, 2024, 5:07 p.m.