Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mpsd-software-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
MPSD Computational Science
mpsd-software-manager
Commits
ffb85ccd
Commit
ffb85ccd
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
first attemp at tests for metadata logging
parent
217397e7
No related branches found
Branches containing commit
No related tags found
1 merge request
!28
improve machine readable logging
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests.py
+9
-0
9 additions, 0 deletions
tests.py
with
9 additions
and
0 deletions
tests.py
+
9
−
0
View file @
ffb85ccd
...
@@ -8,6 +8,7 @@ import subprocess
...
@@ -8,6 +8,7 @@ import subprocess
from
pathlib
import
Path
from
pathlib
import
Path
import
pytest
import
pytest
import
logging
mod
=
importlib
.
import_module
(
"
mpsd-software-environment
"
)
mod
=
importlib
.
import_module
(
"
mpsd-software-environment
"
)
...
@@ -314,6 +315,14 @@ def test_install_environment_zlib():
...
@@ -314,6 +315,14 @@ def test_install_environment_zlib():
lines
=
f
.
read
()
lines
=
f
.
read
()
assert
"
zlib
"
in
lines
assert
"
zlib
"
in
lines
def
test_metadata_logging
(
tmp_path
):
mod
.
set_up_logging
(
"
WARNING
"
,
tmp_path
/
"
test.log
"
)
key
=
"
important_key
"
value
=
"
important_value
"
mod
.
log_metadata
(
key
,
value
)
expected_log
=
f
"
{
mod
.
config_vars
[
'
metadata_tag_open
'
]
}{
key
}
:
{
value
}{
mod
.
config_vars
[
'
metadata_tag_close
'
]
}
"
with
open
(
tmp_path
/
"
test.log
"
,
"
r
"
)
as
f
:
assert
expected_log
in
f
.
read
()
def
test_interface
(
tmp_path
):
def
test_interface
(
tmp_path
):
"""
Test other things (not implemented yet).
"""
"""
Test other things (not implemented yet).
"""
...
...
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