Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
eb78c5d2
Commit
eb78c5d2
authored
Jun 12, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
adab4a66
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+22
-3
No files found.
wcfs/wcfs_test.py
View file @
eb78c5d2
...
...
@@ -962,14 +962,33 @@ def watch(twlink, zf, at, pinok=None): # XXX -> ?
w
.
at
=
at
assert
w
.
pinned
==
twlink
.
_pinAt
(
zf
,
at
)
# stop_watch instructs wlink to stop watching the file.
@
func
(
tWatchLink
)
def
stop_watch
(
twlink
,
zf
):
assert
zf
in
twlink
.
_watching
w
=
twlink
.
_watching
.
pop
(
zf
)
twlink
.
_watch
(
zf
,
b"-"
,
{},
"ok"
)
w
.
at
=
z64
w
.
pinned
=
{}
# _watch sends watch request for zf@at, expects initial pins specified by pinok and final reply.
#
# at also can be b"-" which means "stop watching"
#
# pinok: {} blk -> at that have to be pinned.
# if replyok ends with '…' only reply prefix until the dots is checked.
@
func
(
tWatchLink
)
def
_watch
(
twlink
,
zf
,
at
,
pinok
,
replyok
):
if
at
==
b"-"
:
xat
=
at
else
:
xat
=
b"@%s"
%
h
(
at
)
def
_
(
ctx
,
ev
):
reply
=
twlink
.
sendReq
(
ctx
,
b"watch %s
@%s"
%
(
h
(
zf
.
_p_oid
),
h
(
at
)
))
reply
=
twlink
.
sendReq
(
ctx
,
b"watch %s
%s"
%
(
h
(
zf
.
_p_oid
),
xat
))
if
replyok
.
endswith
(
'…'
):
rok
=
replyok
[:
-
len
(
'…'
)]
assert
reply
[:
len
(
rok
)]
==
rok
...
...
@@ -1285,8 +1304,8 @@ def test_wcfs():
t
.
dump_history
()
#wl3_.watch(zf, "-") XXX enable
wl2
.
close
()
# wl2
should not be notified because it was closed
wl3_
.
stop_watch
(
zf
)
# w3_ should not be notified
wl2
.
close
()
# wl2:*
should not be notified because it was closed
def
w_assertPin
(
pinw3
):
assert
w3
.
pinned
==
pinw3
assert
w3_
.
pinned
==
{};
assert
w3_
.
at
==
z64
# wl3_ unsubscribed from zf
...
...
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