tests/testthat/test-save_model_plot.R

test_that("use, example file", {
  model_filename <- get_gcaer_filename("M0.json")
  expect_true(file.exists(model_filename))
  model <- read_model_file(model_filename)
  png_filename <- get_gcaer_tempfilename(fileext = ".png")
  save_model_plot(
    model = model,
    png_filename = png_filename
  )
  expect_true(file.exists(png_filename))
  file.remove(png_filename)
})

test_that("use", {
  if (!is_gcae_script_fixed()) return()
  model_filename <- get_gcae_model_filename("M1")
  expect_true(file.exists(model_filename))
  model <- read_model_file(model_filename)
  png_filename <- get_gcaer_tempfilename(fileext = ".png")
  save_model_plot(
    model = model,
    png_filename = png_filename
  )
  expect_true(file.exists(png_filename))
  file.remove(png_filename)
})
richelbilderbeek/gcaer documentation built on March 25, 2024, 3:08 p.m.