Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python-imcflibs
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
imcf
python-imcflibs
Commits
d1059df1
Commit
d1059df1
authored
Dec 12, 2018
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Pytest tests for pathtools.parse_path
parent
9ca45448
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_pathtools.py
+33
-0
33 additions, 0 deletions
tests/test_pathtools.py
with
33 additions
and
0 deletions
tests/test_pathtools.py
0 → 100644
+
33
−
0
View file @
d1059df1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import
pytest
from
imcflibs.pathtools
import
parse_path
__author__
=
"
Niko Ehrenfeuchter
"
__copyright__
=
"
Niko Ehrenfeuchter
"
__license__
=
"
gpl3
"
def
test_parse_path
():
path
=
'
/tmp/foo/
'
path_to_dir
=
parse_path
(
path
)
path_to_file
=
parse_path
(
path
+
'
file.ext
'
)
path_to_file_noext
=
parse_path
(
path
+
'
file
'
)
assert
path_to_file
[
'
orig
'
]
==
path
+
'
file.ext
'
assert
path_to_file
[
'
path
'
]
==
path
assert
path_to_file
[
'
dname
'
]
==
'
foo
'
assert
path_to_file
[
'
fname
'
]
==
'
file.ext
'
assert
path_to_file
[
'
ext
'
]
==
'
.ext
'
assert
path_to_file_noext
[
'
ext
'
]
==
''
assert
path_to_file_noext
[
'
fname
'
]
==
'
file
'
assert
path_to_file_noext
[
'
dname
'
]
==
'
foo
'
assert
path_to_file_noext
[
'
path
'
]
==
path
assert
path_to_dir
[
'
path
'
]
==
path
assert
path_to_dir
[
'
fname
'
]
==
''
assert
path_to_dir
[
'
dname
'
]
==
'
foo
'
assert
path_to_dir
[
'
ext
'
]
==
''
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
sign in
to comment