Commit 7465c77a by willmcgugan@gmail.com

Fix for setcontents with empty string

parent 1d6b1906
...@@ -790,7 +790,7 @@ class FS(object): ...@@ -790,7 +790,7 @@ class FS(object):
if not data: if not data:
progress_callback(0) progress_callback(0)
self.createfile(path) self.createfile(path, wipe=True)
finished_callback() finished_callback()
return 0 return 0
......
...@@ -152,6 +152,8 @@ class FSTestCases(object): ...@@ -152,6 +152,8 @@ class FSTestCases(object):
b("to you, good sir!")), chunk_size=2) b("to you, good sir!")), chunk_size=2)
self.assertEquals(self.fs.getcontents( self.assertEquals(self.fs.getcontents(
"hello", "rb"), b("to you, good sir!")) "hello", "rb"), b("to you, good sir!"))
self.fs.setcontents("hello", "", "wb")
self.assertEquals(self.fs.getcontents("hello", "rb"), "")
def test_setcontents_async(self): def test_setcontents_async(self):
# setcontents() should accept both a string... # setcontents() should accept both a string...
......
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