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.
55The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
66and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
77
8+ ## [ 2.4.1] - 2019-02-20
9+
10+ ### Fixed
11+
12+ - Fixed hash method missing from WrapFS
13+
814## [ 2.4.0] - 2019-02-15
915
1016### Added
Original file line number Diff line number Diff line change 11"""Version, used in module and setup.py.
22"""
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):
18351835 self .assertIsInstance (self .fs .glob , glob .BoundGlobber )
18361836
18371837 def test_hash (self ):
1838- self .fs .writebytes ("hashme.txt" , b"foobar" * 1024 )
1838+ self .fs .makedir ( "foo" ). writebytes ("hashme.txt" , b"foobar" * 1024 )
18391839 self .assertEqual (
1840- self .fs .hash ("hashme.txt" , "md5" ), "9fff4bb103ab8ce4619064109c54cb9c"
1840+ self .fs .hash ("foo/ hashme.txt" , "md5" ), "9fff4bb103ab8ce4619064109c54cb9c"
18411841 )
18421842 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):
491491 path = abspath (normpath (path ))
492492 return path
493493
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+
494501 @property
495502 def walk (self ):
496503 # type: () -> BoundWalker
You can’t perform that action at this time.
0 commit comments