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
a4721854
Commit
a4721854
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
add tests for root_dir
parent
15e436de
No related branches found
No related tags found
1 merge request
!89
Implement the init command
Pipeline
#374373
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_mpsd_software.py
+22
-0
22 additions, 0 deletions
tests/test_mpsd_software.py
with
22 additions
and
0 deletions
tests/test_mpsd_software.py
+
22
−
0
View file @
a4721854
...
...
@@ -539,6 +539,28 @@ def test_initialize_environment(tmp_path):
assert
pytest_wrapped_e
.
value
.
code
==
1
def
test_get_root_dir
(
tmp_path
):
"""
Test that the root directory is correct.
"""
with
mod
.
os_chdir
(
tmp_path
):
# test that function exists with error 1 if root dir doesn't exist
with
pytest
.
raises
(
SystemExit
)
as
pytest_wrapped_e
:
mod
.
get_root_dir
()
assert
pytest_wrapped_e
.
type
==
SystemExit
assert
pytest_wrapped_e
.
value
.
code
==
1
# test that initialize_environment creates the root dir
mod
.
initialize_environment
(
tmp_path
)
root_dir
=
mod
.
get_root_dir
()
assert
root_dir
==
tmp_path
# test that root_dir from paret is detected correctly
sub_dir
=
tmp_path
/
"
sub_dir
"
sub_dir
.
mkdir
()
with
mod
.
os_chdir
(
sub_dir
):
root_dir
=
mod
.
get_root_dir
()
assert
root_dir
==
tmp_path
def
test_interface
(
tmp_path
):
"""
Test other things (not implemented yet).
"""
pass
...
...
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