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
6eb56b03
Commit
6eb56b03
authored
Jun 06, 2011
by
gcode@loowis.durge.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unit tests fixup - CREATED is somethimes the second event rather than the first
parent
c2183f01
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
fs/tests/test_watch.py
+7
-5
No files found.
fs/tests/test_watch.py
View file @
6eb56b03
...
...
@@ -53,14 +53,16 @@ class WatcherTestCases:
else
:
time
.
sleep
(
2
)
#0.5)
def
assertEventOccurred
(
self
,
cls
,
path
=
None
,
**
attrs
):
if
not
self
.
checkEventOccurred
(
cls
,
path
,
**
attrs
):
def
assertEventOccurred
(
self
,
cls
,
path
=
None
,
event_list
=
None
,
**
attrs
):
if
not
self
.
checkEventOccurred
(
cls
,
path
,
event_list
,
**
attrs
):
args
=
(
cls
.
__name__
,
path
,
attrs
)
assert
False
,
"Event did not occur:
%
s(
%
s,
%
s)"
%
args
def
checkEventOccurred
(
self
,
cls
,
path
=
None
,
**
attrs
):
def
checkEventOccurred
(
self
,
cls
,
path
=
None
,
event_list
=
None
,
**
attrs
):
if
event_list
is
None
:
event_list
=
self
.
_captured_events
self
.
waitForEvents
()
for
event
in
self
.
_captured_events
:
for
event
in
event_list
:
if
isinstance
(
event
,
cls
):
if
path
is
None
or
event
.
path
==
path
:
for
(
k
,
v
)
in
attrs
.
iteritems
():
...
...
@@ -82,7 +84,7 @@ class WatcherTestCases:
self
.
watchfs
.
add_watcher
(
events2
.
append
)
self
.
fs
.
makedir
(
"test1"
)
self
.
assertEventOccurred
(
CREATED
,
"/test1"
)
self
.
assert
True
(
isinstance
(
events2
[
0
],
CREATED
)
)
self
.
assert
EventOccurred
(
CREATED
,
"/test1"
,
event_list
=
events2
)
def
test_watch_readfile
(
self
):
self
.
setupWatchers
()
...
...
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