Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
214a5448
Commit
214a5448
authored
Oct 16, 2010
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure that movedir(src,dst) raises ResourceNotFoundError is src doesn't exist
parent
71d3b857
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
fs/base.py
+3
-1
fs/tests/__init__.py
+1
-0
No files found.
fs/base.py
View file @
214a5448
...
@@ -783,7 +783,9 @@ class FS(object):
...
@@ -783,7 +783,9 @@ class FS(object):
is required
is required
"""
"""
if
not
self
.
isdir
(
src
):
if
not
self
.
isdir
(
src
):
raise
ResourceInvalidError
(
src
,
msg
=
"Source is not a directory:
%(path)
s"
)
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
):
if
not
overwrite
and
self
.
exists
(
dst
):
raise
DestinationExistsError
(
dst
)
raise
DestinationExistsError
(
dst
)
...
...
fs/tests/__init__.py
View file @
214a5448
...
@@ -406,6 +406,7 @@ class FSTestCases(object):
...
@@ -406,6 +406,7 @@ class FSTestCases(object):
def
makefile
(
path
):
def
makefile
(
path
):
self
.
fs
.
createfile
(
path
,
contents
)
self
.
fs
.
createfile
(
path
,
contents
)
self
.
assertRaises
(
ResourceNotFoundError
,
self
.
fs
.
movedir
,
"a"
,
"b"
)
self
.
fs
.
makedir
(
"a"
)
self
.
fs
.
makedir
(
"a"
)
self
.
fs
.
makedir
(
"b"
)
self
.
fs
.
makedir
(
"b"
)
makefile
(
"a/1.txt"
)
makefile
(
"a/1.txt"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment