Commit 52f3de1a by rfkelly0

implement setcontents() on LazyFS; also add LazyFS to test cases

parent 0e8e303f
......@@ -30,6 +30,21 @@ class TestWrapFS(unittest.TestCase, FSTestCases, ThreadingTestCases):
def check(self, p):
return os.path.exists(os.path.join(self.temp_dir, relpath(p)))
from fs.wrapfs.lazyfs import LazyFS
class TestLazyFS(unittest.TestCase, FSTestCases, ThreadingTestCases):
def setUp(self):
self.temp_dir = tempfile.mkdtemp(u"fstest")
self.fs = LazyFS((osfs.OSFS,(self.temp_dir,)))
def tearDown(self):
shutil.rmtree(self.temp_dir)
def check(self, p):
return os.path.exists(os.path.join(self.temp_dir, relpath(p)))
from fs.wrapfs.limitsizefs import LimitSizeFS
class TestLimitSizeFS(TestWrapFS):
......
......@@ -75,6 +75,8 @@ class LazyFS(WrapFS):
wrapped_fs = property(_get_wrapped_fs,_set_wrapped_fs)
def setcontents(self,path,data):
return self.wrapped_fs.setcontents(path,data)
def close(self):
if not self.closed:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment