15 lines
418 B
Python
15 lines
418 B
Python
import pytest
|
|
|
|
from data.userfiles import DelegateUserfiles
|
|
|
|
@pytest.mark.parametrize('path,expected', [
|
|
('foo', 'test/foo'),
|
|
('bar', 'test/bar'),
|
|
('/bar', 'test/bar'),
|
|
('../foo', 'test/foo'),
|
|
('foo/bar/baz', 'test/baz'),
|
|
('foo/../baz', 'test/baz'),
|
|
])
|
|
def test_filepath(path, expected):
|
|
userfiles = DelegateUserfiles(None, None, 'local_us', 'test')
|
|
assert userfiles.get_file_id_path(path) == expected
|