Skip to content
Snippets Groups Projects
Commit d1059df1 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Pytest tests for pathtools.parse_path

parent 9ca45448
No related branches found
No related tags found
No related merge requests found
#!/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'] == ''
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment