Commit 214a5448 by rfkelly0

ensure that movedir(src,dst) raises ResourceNotFoundError is src doesn't exist

parent 71d3b857
......@@ -783,7 +783,9 @@ class FS(object):
is required
"""
if not self.isdir(src):
if self.isfile(src):
raise ResourceInvalidError(src, msg="Source is not a directory: %(path)s")
raise ResourceNotFoundError(src)
if not overwrite and self.exists(dst):
raise DestinationExistsError(dst)
......
......@@ -406,6 +406,7 @@ class FSTestCases(object):
def makefile(path):
self.fs.createfile(path, contents)
self.assertRaises(ResourceNotFoundError,self.fs.movedir,"a","b")
self.fs.makedir("a")
self.fs.makedir("b")
makefile("a/1.txt")
......
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