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
4e16e489
Commit
4e16e489
authored
Jun 03, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0f1e0c44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
wcfs/internal/xbtree_test.py
wcfs/internal/xbtree_test.py
+12
-4
No files found.
wcfs/internal/xbtree_test.py
View file @
4e16e489
...
@@ -450,7 +450,9 @@ def assertB(znode, *kvv):
...
@@ -450,7 +450,9 @@ def assertB(znode, *kvv):
def
test_restructure
():
def
test_restructure
():
# do restructure tests under ZODB because without ZODB connection it is not
# do restructure tests under ZODB because without ZODB connection it is not
# always possible to __setstate__ for e.g. .../T/B.
# always possible to __setstate__ for e.g. .../T/B. We also want to make
# sure Restructure correctly marks modified nodes as changed so that the
# changes are actually persisted to storage on commit.
zstor
=
MappingStorage
()
zstor
=
MappingStorage
()
db
=
DB
(
zstor
)
db
=
DB
(
zstor
)
zconn
=
db
.
open
()
zconn
=
db
.
open
()
...
@@ -502,10 +504,17 @@ def test_restructure():
...
@@ -502,10 +504,17 @@ def test_restructure():
newStructure
=
newtopo
newStructure
=
newtopo
xbtree
.
Restructure
(
ztree
,
newStructure
)
xbtree
.
Restructure
(
ztree
,
newStructure
)
transaction
.
commit
()
# force objects state to be reloaded from storage.
# this leads further checks to also verify if Restructure modified a
# node, but did not marked it as changed. If this bug is indeed there -
# then the modifications will be lost on live cache clear.
zconn
.
cacheMinimize
()
assert
xbtree
.
StructureOf
(
ztree
,
onlyKeys
=
True
)
==
\
assert
xbtree
.
StructureOf
(
ztree
,
onlyKeys
=
True
)
==
\
newStructure
.
copy
(
onlyKeys
=
True
)
newStructure
.
copy
(
onlyKeys
=
True
)
# verify iteration produces
s
the same [] of (key, v)
# verify iteration produces the same [] of (key, v)
assert
list
(
ztree
.
items
())
==
items
assert
list
(
ztree
.
items
())
==
items
# verify [k] gives the same v (for all k)
# verify [k] gives the same v (for all k)
for
(
k
,
v
)
in
items
:
for
(
k
,
v
)
in
items
:
...
@@ -726,9 +735,8 @@ def test_restructure():
...
@@ -726,9 +735,8 @@ def test_restructure():
R(z, 'T4/T2-T/T-T-T6,10/B1-B3-T-T-T/T-B7-B11/B5')
R(z, 'T4/T2-T/T-T-T6,10/B1-B3-T-T-T/T-B7-B11/B5')
R(z, 'T/B1,3,5,7,11')
R(z, 'T/B1,3,5,7,11')
# make sure changed objects are marked as such and so included into commit
# make sure changed objects are marked as such and so included into commit
# (just R also partly verifies this on every call)
z = Z(0,2,3)
z = Z(0,2,3)
transaction.commit()
transaction.commit()
def Rz(newtopo):
def Rz(newtopo):
...
...
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