diff --git a/tests/testthat/test-sim_utils.R b/tests/testthat/test-sim_utils.R index 8aaf993aa56ed01c122313faa41cefef3bb3aeb9..8f7ce2f5a3d548636d294878c50dae93efd55422 100644 --- a/tests/testthat/test-sim_utils.R +++ b/tests/testthat/test-sim_utils.R @@ -5,17 +5,16 @@ # test_that("run_simulation works", { # -# ogs_bin_path <- paste0("D:\\Programme\\OpenGeoSys\\", -# "ogs-6.3.2-Windows-10.0.14393-x64-python-3.7.2"," -# -de-utils\\bin\\") +# ogs_bin_path <- paste0("D:/Programme/OpenGeoSys/", +# "ogs-6.3.2-Windows-10.0.14393-x64-python-3.7.2", +# "-de-utils/bin/") # # sim_path <- system.file("extdata/test_sim/", package = "r2ogs6") -# sim_path <- validate_is_dir_path(sim_path) # # # Define OGS6 object # ogs6_obj <- OGS6$new(sim_name = "sim", # sim_id = 1, -# sim_path = simdir_path, +# sim_path = "D:/OGS_Sim/", # ogs_bin_path = ogs_bin_path) # # # Define path to .prj file @@ -30,7 +29,7 @@ # run_simulation(ogs6_obj) # # # 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 # expect_equal(file.exists(paste0(sim_path, "sim_log.txt")), TRUE) @@ -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) -}) - -