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
fac36e13
Commit
fac36e13
authored
May 03, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
723388c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+18
-6
No files found.
wcfs/wcfs_test.py
View file @
fac36e13
...
@@ -544,6 +544,7 @@ class tWatch:
...
@@ -544,6 +544,7 @@ class tWatch:
req
=
t
.
recvReq
(
ctx
)
req
=
t
.
recvReq
(
ctx
)
except
Exception
as
e
:
except
Exception
as
e
:
raise
RuntimeError
(
"%s
\
n
not all pin missages received - pending:
\
n
%s"
%
(
e
,
expected
))
raise
RuntimeError
(
"%s
\
n
not all pin missages received - pending:
\
n
%s"
%
(
e
,
expected
))
assert
False
# XXX temp
assert
req
is
not
None
# channel not closed
assert
req
is
not
None
# channel not closed
assert
req
.
msg
in
expected
assert
req
.
msg
in
expected
expected
.
remove
(
req
.
msg
)
expected
.
remove
(
req
.
msg
)
...
@@ -658,6 +659,7 @@ def test_wcfs():
...
@@ -658,6 +659,7 @@ def test_wcfs():
print
(
'
\
n
\
n
inv. protocol
\
n
\
n
'
)
print
(
'
\
n
\
n
inv. protocol
\
n
\
n
'
)
w
=
t
.
openwatch
()
w
=
t
.
openwatch
()
"""
ctx = context.background() # XXX stub
ctx = context.background() # XXX stub
wg = sync.WorkGroup(ctx)
wg = sync.WorkGroup(ctx)
...
@@ -670,6 +672,7 @@ def test_wcfs():
...
@@ -670,6 +672,7 @@ def test_wcfs():
assert w.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at1))) == "ok"
assert w.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at1))) == "ok"
wg.go(_)
wg.go(_)
wg.wait()
wg.wait()
"""
print
(
'
\
n
CCC
\
n
'
)
print
(
'
\
n
CCC
\
n
'
)
bg
=
context
.
background
()
bg
=
context
.
background
()
...
@@ -677,7 +680,7 @@ def test_wcfs():
...
@@ -677,7 +680,7 @@ def test_wcfs():
# checkSetupWatch verifies setting up new watch for zf@at.
# checkSetupWatch verifies setting up new watch for zf@at.
def
checkSetupWatch
(
zf
,
at
):
def
checkSetupWatch
(
zf
,
at
):
print
(
'C: check setup watch f
%s
%s'
%
(
h
(
zf
.
_p_oid
),
t
.
hat
(
at
)))
print
(
'C: check setup watch f
<%s>
%s'
%
(
h
(
zf
.
_p_oid
),
t
.
hat
(
at
)))
# all changes to zf
# all changes to zf
vdf
=
[
_
.
byfile
[
zf
]
for
_
in
t
.
dFtail
if
zf
in
_
.
byfile
]
vdf
=
[
_
.
byfile
[
zf
]
for
_
in
t
.
dFtail
if
zf
in
_
.
byfile
]
...
@@ -710,12 +713,21 @@ def test_wcfs():
...
@@ -710,12 +713,21 @@ def test_wcfs():
for
p
in
pinv
:
for
p
in
pinv
:
p
.
reply
(
b"ack"
)
p
.
reply
(
b"ack"
)
wg
.
go
(
_
)
wg
.
go
(
_
)
assert
w
.
sendReq
(
ctx
,
b"watch %s @%s"
%
(
h
(
zf
.
_p_oid
),
h
(
at
)))
==
"ok"
def
_
(
ctx
):
# cancel expectPin waiting upon receiving "ok" from wcfs
assert
w
.
sendReq
(
ctx
,
b"watch %s @%s"
%
(
h
(
zf
.
_p_oid
),
h
(
at
)))
==
"ok"
# -> error that missed pins were not received.
# cancel expectPin waiting upon receiving "ok" from wcfs
cancel
()
# -> error that missed pins were not received.
wg
.
wait
()
cancel
()
wg
.
go
(
_
)
try
:
wg
.
wait
()
except
:
import
traceback
traceback
.
print_exc
()
raise
# XXX for zf: check all revisions, even if zf was not changed in rev
for
dF
in
t
.
dFtail
:
for
dF
in
t
.
dFtail
:
for
zf
in
dF
.
byfile
:
for
zf
in
dF
.
byfile
:
checkSetupWatch
(
zf
,
dF
.
rev
)
checkSetupWatch
(
zf
,
dF
.
rev
)
...
...
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