File tree Expand file tree Collapse file tree 4 files changed +36
-1
lines changed
Expand file tree Collapse file tree 4 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
55and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
66
7+
8+ ## [ 2.0.2] - 2017-03.12
9+
10+ ### Changed
11+ Improved FTP support for non-compliant servers
12+ Fix for ZipFS implied directories
13+
714## [ 2.0.1] - 2017-03-11
815
916### Added
Original file line number Diff line number Diff line change 1- __version__ = "2.0.2a0 "
1+ __version__ = "2.0.2 "
Original file line number Diff line number Diff line change @@ -126,3 +126,8 @@ def test_walk_files(self):
126126 source_files ,
127127 archive_files
128128 )
129+
130+ def test_implied_dir (self ):
131+ self .fs .getinfo ('foo/bar' )
132+ self .fs .getinfo ('foo' )
133+
Original file line number Diff line number Diff line change 33import os
44import tempfile
55import unittest
6+ import zipfile
67
78from fs import zipfs
89from fs .compress import write_zip
@@ -52,3 +53,25 @@ class TestReadZipFSMem(TestReadZipFS):
5253
5354 def make_source_fs (self ):
5455 return open_fs ('mem://' )
56+
57+
58+ class TestDirsZipFS (unittest .TestCase ):
59+
60+ def test_implied (self ):
61+ """Test zipfs creates intermediate directories."""
62+ fh , path = tempfile .mkstemp ('testzip.zip' )
63+ try :
64+ os .close (fh )
65+ _zip_file = zipfile .ZipFile (path , mode = 'w' )
66+ _zip_file .writestr ('foo/bar/baz/egg' , b'hello' )
67+ _zip_file .close ()
68+ zip_fs = zipfs .ZipFS (path )
69+ zip_fs .getinfo ('foo' )
70+ zip_fs .getinfo ('foo/bar' )
71+ zip_fs .getinfo ('foo/bar/baz' )
72+ self .assertTrue (zip_fs .isdir ('foo/bar/baz' ))
73+ self .assertTrue (zip_fs .isfile ('foo/bar/baz/egg' ))
74+ finally :
75+ os .remove (path )
76+
77+
You can’t perform that action at this time.
0 commit comments