summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/__init__.py2
-rw-r--r--fs/remote.py3
-rw-r--r--fs/tests/__init__.py4
-rw-r--r--fs/tests/test_remote.py5
4 files changed, 8 insertions, 6 deletions
diff --git a/fs/__init__.py b/fs/__init__.py
index 386e988..3f1b352 100644
--- a/fs/__init__.py
+++ b/fs/__init__.py
@@ -15,7 +15,7 @@ implementations of this interface such as:
"""
-__version__ = "0.2.0a8"
+__version__ = "0.2.0a9"
__author__ = "Will McGugan (will@willmcgugan.com)"
# 'base' imports * from 'path' and 'errors', so their
diff --git a/fs/remote.py b/fs/remote.py
index 16c9689..c21f8b3 100644
--- a/fs/remote.py
+++ b/fs/remote.py
@@ -231,6 +231,9 @@ class ConnectionManagerFS(WrapFS):
finally:
self._connection_cond.release()
+ def setcontents(self,path,data):
+ self.wrapped_fs.setcontents(path,data)
+
def __getstate__(self):
state = super(ConnectionManagerFS,self).__getstate__()
del state["_connection_cond"]
diff --git a/fs/tests/__init__.py b/fs/tests/__init__.py
index d422d14..2f607f5 100644
--- a/fs/tests/__init__.py
+++ b/fs/tests/__init__.py
@@ -597,6 +597,7 @@ class ThreadingTestCases:
if self.fs.exists(subdir):
self.fs.removedir(subdir,force=True)
self.assertFalse(self.fs.isdir(subdir))
+ self.assertTrue(self.fs.isdir("/"))
self.fs.makedir(subdir)
self._yield()
getattr(this,meth)()
@@ -637,7 +638,8 @@ class ThreadingTestCases:
# One thread should succeed, two should error
errors = []
self._runThreads(makedir,makedir,makedir)
- self.assertEquals(len(errors),2)
+ if len(errors) != 2:
+ raise AssertionError(errors)
self.fs.removedir("testdir")
# All threads should succeed
errors = []
diff --git a/fs/tests/test_remote.py b/fs/tests/test_remote.py
index d607f30..fc687c9 100644
--- a/fs/tests/test_remote.py
+++ b/fs/tests/test_remote.py
@@ -74,20 +74,17 @@ class DisconnectingFS(WrapFS):
self._continue = False
self._bounce_thread.join()
self._connected = True
- self.wrapped_fs.close()
super(DisconnectingFS,self).close()
def disconnecting_wrapper(func):
"""Method wrapper to raise RemoteConnectionError if not connected."""
- if func.__name__ == "close":
- return func
@wraps(func)
def wrapper(self,*args,**kwds):
if not self._connected:
raise RemoteConnectionError("")
return func(self,*args,**kwds)
return wrapper
-DisconnectingFS = wrap_fs_methods(disconnecting_wrapper)(DisconnectingFS)
+DisconnectingFS = wrap_fs_methods(disconnecting_wrapper,DisconnectingFS,exclude=["close"])
class DisconnectRecoveryFS(WrapFS):