Skip to content
Snippets Groups Projects
Commit 5aeacf7f authored by Ruben Heinrich's avatar Ruben Heinrich
Browse files

[tests] Removed unneeded function

parent 1f1acb92
No related branches found
No related tags found
1 merge request!6Merge branch 7 fixed functionality into master
...@@ -5,17 +5,16 @@ ...@@ -5,17 +5,16 @@
# test_that("run_simulation works", { # test_that("run_simulation works", {
# #
# ogs_bin_path <- paste0("D:\\Programme\\OpenGeoSys\\", # ogs_bin_path <- paste0("D:/Programme/OpenGeoSys/",
# "ogs-6.3.2-Windows-10.0.14393-x64-python-3.7.2"," # "ogs-6.3.2-Windows-10.0.14393-x64-python-3.7.2",
# -de-utils\\bin\\") # "-de-utils/bin/")
# #
# sim_path <- system.file("extdata/test_sim/", package = "r2ogs6") # sim_path <- system.file("extdata/test_sim/", package = "r2ogs6")
# sim_path <- validate_is_dir_path(sim_path)
# #
# # Define OGS6 object # # Define OGS6 object
# ogs6_obj <- OGS6$new(sim_name = "sim", # ogs6_obj <- OGS6$new(sim_name = "sim",
# sim_id = 1, # sim_id = 1,
# sim_path = simdir_path, # sim_path = "D:/OGS_Sim/",
# ogs_bin_path = ogs_bin_path) # ogs_bin_path = ogs_bin_path)
# #
# # Define path to .prj file # # Define path to .prj file
...@@ -30,7 +29,7 @@ ...@@ -30,7 +29,7 @@
# run_simulation(ogs6_obj) # run_simulation(ogs6_obj)
# #
# # Check if output file was written # # Check if output file was written
# expect_equal(file.exists(paste0(sim_path, "flow_no_strain.prj")), TRUE) # expect_equal(file.exists(paste0(sim_path, "sim.prj")), TRUE)
# #
# # Check if log file was written # # Check if log file was written
# expect_equal(file.exists(paste0(sim_path, "sim_log.txt")), TRUE) # expect_equal(file.exists(paste0(sim_path, "sim_log.txt")), TRUE)
...@@ -40,35 +39,3 @@ ...@@ -40,35 +39,3 @@
# }) # })
test_that("setup_logging works", {
# Create placeholder sim parameters
sim_name <- "test"
ogs6_call <- "ogs6 call"
# Create placeholder sim_path directory
extdata_path <- system.file("extdata/", package = "r2ogs6")
sim_path <- paste0(extdata_path, "/log_test")
dir.create(sim_path)
batch_str <- setup_logging(sim_name,
sim_path,
ogs6_call)
# Check if logfile directory was written
expect_equal(dir.exists(paste0(sim_path, "/logfiles")), TRUE)
script_path <- paste0(sim_path, "/logfiles/sim_init.R")
# Check if initialization script was written
expect_equal(file.exists(script_path), TRUE)
# Check contents of initialization script
expect_equal(readLines(script_path), "system(command = \"ogs6 call\")")
# Clean up folder
unlink(sim_path, recursive = TRUE)
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment