Skip to content

Commit

Permalink
May 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
vda1r22 committed May 14, 2024
1 parent b763a6c commit 8e896d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Binary file modified tests/testthat/Rplots.pdf
Binary file not shown.
8 changes: 6 additions & 2 deletions tests/testthat/test-bbn.predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ test_that("bbn.predict saves plot to PDF when figure is 1", {
data("my_BBN")
data("dogwhelk")

# Define the path to the test plot in the temporary directory
test_plot_path <- file.path(tempdir(), "BBN_Output_RenameMe.pdf")

# Ensure any previous test file is removed
test_plot_path <- "BBN_Output_RenameMe.pdf"
if(file.exists(test_plot_path)) {
if (file.exists(test_plot_path)) {
file.remove(test_plot_path)
}

# Call the function with the correct parameters
bbn.predict(bbn.model = my_BBN, priors1 = dogwhelk, figure = 1)

# Check if the file now exists
Expand All @@ -46,6 +49,7 @@ test_that("bbn.predict saves plot to PDF when figure is 1", {
file.remove(test_plot_path)
})


test_that("bbn.predict runs without error for figure = 2", {
data("my_BBN")
data("dogwhelk")
Expand Down

0 comments on commit 8e896d8

Please sign in to comment.