16 |
# MA 02111-1307 USA |
# MA 02111-1307 USA |
17 |
# |
# |
18 |
|
|
19 |
|
def test_slashify(): |
20 |
|
"""Test slashifying a path.""" |
21 |
|
from navidoc.util.path import slashify |
22 |
|
assert slashify('') == '', slashify('') |
23 |
|
assert slashify('foo') == 'foo/', slashify('foo') |
24 |
|
assert slashify('foo/') == 'foo/', slashify('foo/') |
25 |
|
|
26 |
def test_relative_path(): |
def test_relative_path(): |
27 |
"""Test building of relative path.""" |
"""Test building of relative path.""" |
28 |
from navidoc.util.path import relative_path |
from navidoc.util.path import relative_path |
29 |
assert relative_path('navidoc', 'test') == '../test/', relative_path('navidoc', 'test') |
assert relative_path('navidoc', 'test') == '../test/', relative_path('navidoc', 'test') |
30 |
|
assert relative_path('', 'test') == 'test', relative_path('', 'test') |
31 |
|
assert relative_path('navidoc', 'Makefile') == '../Makefile', relative_path('navidoc', 'Makefile') |
32 |
|
assert relative_path('navidoc/__init__.py', 'Makefile') == '../Makefile', relative_path('navidoc/__init__.py', 'Makefile') |
33 |
|
assert relative_path('navidoc/util', 'test/path.test') == '../../test/path.test', relative_path('navidoc/util', 'test/path.test') |