Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
r2ogs6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ogs
OpenGeoSys Tools
r2ogs6
Commits
3f561336
"git@gitlab.opengeosys.org:Mojtaba-abdolkhani/ogs.git" did not exist on "2521219e473e3613456aaa942a431854ce79aa1b"
Commit
3f561336
authored
4 years ago
by
Ruben Heinrich
Browse files
Options
Downloads
Patches
Plain Diff
[tests] Modified sim_utils tests
parent
1f727693
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/testthat/test-sim_utils.R
+34
-0
34 additions, 0 deletions
tests/testthat/test-sim_utils.R
with
34 additions
and
0 deletions
tests/testthat/test-sim_utils.R
+
34
−
0
View file @
3f561336
...
@@ -38,3 +38,37 @@
...
@@ -38,3 +38,37 @@
# # Clean up folder
# # Clean up folder
# do.call(file.remove, list(list.files(sim_path, full.names = TRUE)))
# do.call(file.remove, list(list.files(sim_path, full.names = TRUE)))
# })
# })
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
)
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment