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
d4225703
Commit
d4225703
authored
Aug 09, 2010
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
factor dokan-specific test fixes into a mixin, so I can use them in other (proprietary) test suites
parent
90309475
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
22 deletions
+28
-22
fs/tests/test_expose.py
+28
-22
No files found.
fs/tests/test_expose.py
View file @
d4225703
...
@@ -139,7 +139,34 @@ except ImportError:
...
@@ -139,7 +139,34 @@ except ImportError:
pass
pass
else
:
else
:
from
fs.osfs
import
OSFS
from
fs.osfs
import
OSFS
class
TestDokan
(
unittest
.
TestCase
,
FSTestCases
,
ThreadingTestCases
):
class
DokanTestCases
(
FSTestCases
):
"""Specialised testcases for filesystems exposed via Dokan.
This modifies some of the standard tests to work around apparent
bugs in the current Dokan implementation.
"""
def
test_remove
(
self
):
self
.
fs
.
createfile
(
"a.txt"
)
self
.
assertTrue
(
self
.
check
(
"a.txt"
))
self
.
fs
.
remove
(
"a.txt"
)
self
.
assertFalse
(
self
.
check
(
"a.txt"
))
self
.
assertRaises
(
ResourceNotFoundError
,
self
.
fs
.
remove
,
"a.txt"
)
self
.
fs
.
makedir
(
"dir1"
)
# This appears to be a bug in Dokan - DeleteFile will happily
# delete an empty directory.
#self.assertRaises(ResourceInvalidError,self.fs.remove,"dir1")
self
.
fs
.
createfile
(
"/dir1/a.txt"
)
self
.
assertTrue
(
self
.
check
(
"dir1/a.txt"
))
self
.
fs
.
remove
(
"dir1/a.txt"
)
self
.
assertFalse
(
self
.
check
(
"/dir1/a.txt"
))
def
test_settimes
(
self
):
# Setting the times does actually work, but there's some sort
# of caching effect which prevents them from being read back
# out. Disabling the test for now.
pass
class
TestDokan
(
unittest
.
TestCase
,
DokanTestCases
,
ThreadingTestCases
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
temp_fs
=
TempFS
()
self
.
temp_fs
=
TempFS
()
...
@@ -167,24 +194,3 @@ else:
...
@@ -167,24 +194,3 @@ else:
self
.
mount_proc
.
terminate
()
self
.
mount_proc
.
terminate
()
self
.
temp_fs
.
close
()
self
.
temp_fs
.
close
()
def
test_remove
(
self
):
self
.
fs
.
createfile
(
"a.txt"
)
self
.
assertTrue
(
self
.
check
(
"a.txt"
))
self
.
fs
.
remove
(
"a.txt"
)
self
.
assertFalse
(
self
.
check
(
"a.txt"
))
self
.
assertRaises
(
ResourceNotFoundError
,
self
.
fs
.
remove
,
"a.txt"
)
self
.
fs
.
makedir
(
"dir1"
)
# This appears to be a bug in Dokan - DeleteFile will happily
# delete an empty directory.
#self.assertRaises(ResourceInvalidError,self.fs.remove,"dir1")
self
.
fs
.
createfile
(
"/dir1/a.txt"
)
self
.
assertTrue
(
self
.
check
(
"dir1/a.txt"
))
self
.
fs
.
remove
(
"dir1/a.txt"
)
self
.
assertFalse
(
self
.
check
(
"/dir1/a.txt"
))
def
test_settimes
(
self
):
# Setting the times does actually work, but there's some sort
# of cachine effect which prevents them from being read back
# out. Disabling the test for now.
pass
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