File tree Expand file tree Collapse file tree 4 files changed +23
-4
lines changed Expand file tree Collapse file tree 4 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
6
6
and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
7
7
8
+ ## [ 2.4.1] - 2019-02-20
9
+
10
+ ### Fixed
11
+
12
+ - Fixed hash method missing from WrapFS
13
+
8
14
## [ 2.4.0] - 2019-02-15
9
15
10
16
### Added
Original file line number Diff line number Diff line change 1
1
"""Version, used in module and setup.py.
2
2
"""
3
- __version__ = "2.4.0 "
3
+ __version__ = "2.4.1 "
Original file line number Diff line number Diff line change @@ -1835,9 +1835,15 @@ def test_glob(self):
1835
1835
self .assertIsInstance (self .fs .glob , glob .BoundGlobber )
1836
1836
1837
1837
def test_hash (self ):
1838
- self .fs .writebytes ("hashme.txt" , b"foobar" * 1024 )
1838
+ self .fs .makedir ( "foo" ). writebytes ("hashme.txt" , b"foobar" * 1024 )
1839
1839
self .assertEqual (
1840
- self .fs .hash ("hashme.txt" , "md5" ), "9fff4bb103ab8ce4619064109c54cb9c"
1840
+ self .fs .hash ("foo/ hashme.txt" , "md5" ), "9fff4bb103ab8ce4619064109c54cb9c"
1841
1841
)
1842
1842
with self .assertRaises (errors .UnsupportedHash ):
1843
- self .fs .hash ("hashme.txt" , "nohash" )
1843
+ self .fs .hash ("foo/hashme.txt" , "nohash" )
1844
+
1845
+ with self .fs .opendir ("foo" ) as foo_fs :
1846
+ self .assertEqual (
1847
+ foo_fs .hash ("hashme.txt" , "md5" ), "9fff4bb103ab8ce4619064109c54cb9c"
1848
+ )
1849
+
Original file line number Diff line number Diff line change @@ -491,6 +491,13 @@ def validatepath(self, path):
491
491
path = abspath (normpath (path ))
492
492
return path
493
493
494
+ def hash (self , path , name ):
495
+ # type: (Text, Text) -> Text
496
+ self .check ()
497
+ _fs , _path = self .delegate_path (path )
498
+ with unwrap_errors (path ):
499
+ return _fs .hash (_path , name )
500
+
494
501
@property
495
502
def walk (self ):
496
503
# type: () -> BoundWalker
You can’t perform that action at this time.
0 commit comments