Normalize filename in ZipLoader. Fixes #49

This commit is contained in:
Sergey Lavrinenko 2015-04-03 19:24:33 +03:00
parent b4e725bbdc
commit dd7d4979e8
2 changed files with 4 additions and 1 deletions

View File

@ -202,6 +202,8 @@ class ZipLoader(BaseLoader):
if self.base_path:
name = path.join(self.base_path, name)
name = path.join(*split_template_path(name))
self._unpack()
if isinstance(name, str):

View File

@ -177,6 +177,7 @@ def test_local_store1():
assert 'images/arrow.png' in files_list
assert len(files_list) in [15, 16]
# TODO: remove directories from zip loader list_files results
assert loader.get_file('./images/img01.jpg') == loader.get_file('images/img01.jpg')
def test_split_template_path():
@ -206,4 +207,4 @@ def test_base_loader():
# Raises exception when no html file
l._files = ['a.gif', '__MACOSX/.index.html']
with pytest.raises(FileNotFound):
print(l.find_index_file())
print(l.find_index_file())