Skip to content

Commit 3cb3e7f

Browse files
committed
mountfs fix and test
1 parent df159b0 commit 3cb3e7f

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

fs/mountfs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ def gettext(self, path, encoding=None, errors=None, newline=None):
154154
def getsize(self, path):
155155
self.check()
156156
fs, _path = self._delegate(path)
157-
return fs.getsize(path)
157+
return fs.getsize(_path)
158158

159159
def getsyspath(self, path):
160160
self.check()
161161
fs, _path = self._delegate(path)
162-
return fs.getsyspath(path)
162+
return fs.getsyspath(_path)
163163

164164
def gettype(self, path):
165165
self.check()
@@ -194,7 +194,7 @@ def scandir(self, path, namespaces=None, page=None):
194194
def setinfo(self, path, info):
195195
self.check()
196196
fs, _path = self._delegate(path)
197-
return fs.setinfo(path, info)
197+
return fs.setinfo(_path, info)
198198

199199
def validatepath(self, path):
200200
self.check()
@@ -225,12 +225,12 @@ def open(self,
225225
def setbinfile(self, path, file):
226226
self.check()
227227
fs, _path = self._delegate(path)
228-
return fs.setbinfile(path, file)
228+
return fs.setbinfile(_path, file)
229229

230230
def setbytes(self, path, contents):
231231
self.check()
232232
fs, _path = self._delegate(path)
233-
return fs.setbytes(path, contents)
233+
return fs.setbytes(_path, contents)
234234

235235
def settext(self,
236236
path,

tests/test_mountfs.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ def make_fs(self):
1818
return fs
1919

2020

21+
class TestMountFS2(FSTestCases, unittest.TestCase):
22+
"""Test OSFS implementation."""
23+
24+
def make_fs(self):
25+
fs = MountFS()
26+
mem_fs = MemoryFS()
27+
fs.mount('/foo', mem_fs)
28+
return fs.opendir('foo')
29+
30+
2131
class TestMountFSBehaviours(unittest.TestCase):
2232

2333
def test_listdir(self):

0 commit comments

Comments
 (0)