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
6bd0201e
Commit
6bd0201e
authored
Jun 16, 2009
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new threading testcase - multiple overwrites to a file
parent
dc39faf6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
fs/tests/__init__.py
+16
-0
No files found.
fs/tests/__init__.py
View file @
6bd0201e
...
@@ -305,6 +305,7 @@ class FSTestCases:
...
@@ -305,6 +305,7 @@ class FSTestCases:
self
.
assert_
(
checkcontents
(
"/c.txt"
))
self
.
assert_
(
checkcontents
(
"/c.txt"
))
makefile
(
"foo/bar/a.txt"
,
"different contents"
)
makefile
(
"foo/bar/a.txt"
,
"different contents"
)
self
.
assert_
(
checkcontents
(
"foo/bar/a.txt"
,
"different contents"
))
self
.
assertRaises
(
DestinationExistsError
,
self
.
fs
.
copy
,
"foo/bar/a.txt"
,
"/c.txt"
)
self
.
assertRaises
(
DestinationExistsError
,
self
.
fs
.
copy
,
"foo/bar/a.txt"
,
"/c.txt"
)
self
.
assert_
(
checkcontents
(
"/c.txt"
))
self
.
assert_
(
checkcontents
(
"/c.txt"
))
self
.
fs
.
copy
(
"foo/bar/a.txt"
,
"/c.txt"
,
overwrite
=
True
)
self
.
fs
.
copy
(
"foo/bar/a.txt"
,
"/c.txt"
,
overwrite
=
True
)
...
@@ -628,3 +629,18 @@ class ThreadingTestCases:
...
@@ -628,3 +629,18 @@ class ThreadingTestCases:
self
.
assertEqual
(
self
.
fs
.
getcontents
(
"copy of a/hello.txt"
),
"hello world"
)
self
.
assertEqual
(
self
.
fs
.
getcontents
(
"copy of a/hello.txt"
),
"hello world"
)
self
.
assertEqual
(
self
.
fs
.
getcontents
(
"copy of a/guido.txt"
),
"is a space alien"
)
self
.
assertEqual
(
self
.
fs
.
getcontents
(
"copy of a/guido.txt"
),
"is a space alien"
)
def
test_multiple_overwrite
(
self
):
contents
=
[
"contents one"
,
"contents the second"
,
"number three"
]
def
thread1
():
for
i
in
xrange
(
30
):
for
c
in
contents
:
self
.
fs
.
setcontents
(
"thread1.txt"
,
c
)
self
.
assertEquals
(
self
.
fs
.
getcontents
(
"thread1.txt"
),
c
)
def
thread2
():
for
i
in
xrange
(
30
):
for
c
in
contents
:
self
.
fs
.
setcontents
(
"thread2.txt"
,
c
)
self
.
assertEquals
(
self
.
fs
.
getcontents
(
"thread2.txt"
),
c
)
self
.
_runThreads
(
thread1
,
thread2
)
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