Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
be79edc1
Commit
be79edc1
authored
Aug 14, 2002
by
Martijn Pieters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up indentation and trailing whitespace.
parent
80470838
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
43 additions
and
45 deletions
+43
-45
src/BTrees/IIBTree.py
src/BTrees/IIBTree.py
+2
-2
src/BTrees/IOBTree.py
src/BTrees/IOBTree.py
+2
-2
src/BTrees/Length.py
src/BTrees/Length.py
+2
-2
src/BTrees/OIBTree.py
src/BTrees/OIBTree.py
+2
-2
src/BTrees/OOBTree.py
src/BTrees/OOBTree.py
+2
-2
src/BTrees/convert.py
src/BTrees/convert.py
+2
-2
src/BTrees/tests/__init__.py
src/BTrees/tests/__init__.py
+0
-1
src/BTrees/tests/testBTrees.py
src/BTrees/tests/testBTrees.py
+5
-5
src/BTrees/tests/testConflict.py
src/BTrees/tests/testConflict.py
+26
-27
No files found.
src/BTrees/IIBTree.py
View file @
be79edc1
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
#
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
##############################################################################
# hack to overcome dynamic-linking headache.
# hack to overcome dynamic-linking headache.
...
...
src/BTrees/IOBTree.py
View file @
be79edc1
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
#
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
##############################################################################
# hack to overcome dynamic-linking headache.
# hack to overcome dynamic-linking headache.
...
...
src/BTrees/Length.py
View file @
be79edc1
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
#
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
##############################################################################
import
Persistence
import
Persistence
...
...
src/BTrees/OIBTree.py
View file @
be79edc1
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
#
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
##############################################################################
# hack to overcome dynamic-linking headache.
# hack to overcome dynamic-linking headache.
...
...
src/BTrees/OOBTree.py
View file @
be79edc1
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
#
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
##############################################################################
# hack to overcome dynamic-linking headache.
# hack to overcome dynamic-linking headache.
...
...
src/BTrees/convert.py
View file @
be79edc1
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
#
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
##############################################################################
def
convert
(
old
,
new
,
threshold
=
200
,
f
=
None
,
None
=
None
):
def
convert
(
old
,
new
,
threshold
=
200
,
f
=
None
,
None
=
None
):
...
...
src/BTrees/tests/__init__.py
View file @
be79edc1
# If tests is a package, debugging is a bit easier.
# If tests is a package, debugging is a bit easier.
src/BTrees/tests/testBTrees.py
View file @
be79edc1
...
@@ -1126,11 +1126,11 @@ def test_suite():
...
@@ -1126,11 +1126,11 @@ def test_suite():
## utility functions
## utility functions
def
lsubtract
(
l1
,
l2
):
def
lsubtract
(
l1
,
l2
):
l1
=
list
(
l1
)
l1
=
list
(
l1
)
l2
=
list
(
l2
)
l2
=
list
(
l2
)
l
=
filter
(
lambda
x
,
l1
=
l1
:
x
not
in
l1
,
l2
)
l
=
filter
(
lambda
x
,
l1
=
l1
:
x
not
in
l1
,
l2
)
l
=
l
+
filter
(
lambda
x
,
l2
=
l2
:
x
not
in
l2
,
l1
)
l
=
l
+
filter
(
lambda
x
,
l2
=
l2
:
x
not
in
l2
,
l1
)
return
l
return
l
def
realseq
(
itemsob
):
def
realseq
(
itemsob
):
return
map
(
lambda
x
:
x
,
itemsob
)
return
map
(
lambda
x
:
x
,
itemsob
)
...
...
src/BTrees/tests/testConflict.py
View file @
be79edc1
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
#
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# FOR A PARTICULAR PURPOSE
#
#
##############################################################################
##############################################################################
import
os
import
os
...
@@ -50,7 +50,7 @@ class MappingBase(Base):
...
@@ -50,7 +50,7 @@ class MappingBase(Base):
del
self
.
t
[
1
]
del
self
.
t
[
1
]
def
_setupConflict
(
self
):
def
_setupConflict
(
self
):
l
=
[
-
5124
,
-
7377
,
2274
,
8801
,
-
9901
,
7327
,
1565
,
17
,
-
679
,
l
=
[
-
5124
,
-
7377
,
2274
,
8801
,
-
9901
,
7327
,
1565
,
17
,
-
679
,
3686
,
-
3607
,
14
,
6419
,
-
5637
,
6040
,
-
4556
,
-
8622
,
3847
,
7191
,
3686
,
-
3607
,
14
,
6419
,
-
5637
,
6040
,
-
4556
,
-
8622
,
3847
,
7191
,
-
4067
]
-
4067
]
...
@@ -59,7 +59,7 @@ class MappingBase(Base):
...
@@ -59,7 +59,7 @@ class MappingBase(Base):
e1
=
[(
-
1704
,
0
),
(
5420
,
1
),
(
-
239
,
2
),
(
4024
,
3
),
(
-
6984
,
4
)]
e1
=
[(
-
1704
,
0
),
(
5420
,
1
),
(
-
239
,
2
),
(
4024
,
3
),
(
-
6984
,
4
)]
e2
=
[(
7745
,
0
),
(
4868
,
1
),
(
-
2548
,
2
),
(
-
2711
,
3
),
(
-
3154
,
4
)]
e2
=
[(
7745
,
0
),
(
4868
,
1
),
(
-
2548
,
2
),
(
-
2711
,
3
),
(
-
3154
,
4
)]
base
=
self
.
t
base
=
self
.
t
base
.
update
([(
i
,
i
*
i
)
for
i
in
l
[:
20
]])
base
.
update
([(
i
,
i
*
i
)
for
i
in
l
[:
20
]])
b1
=
base
.
__class__
(
base
)
b1
=
base
.
__class__
(
base
)
...
@@ -126,7 +126,7 @@ class MappingBase(Base):
...
@@ -126,7 +126,7 @@ class MappingBase(Base):
b2
[
items
[
0
][
0
]]
=-
9
b2
[
items
[
0
][
0
]]
=-
9
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge conflicting update and delete'
,
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge conflicting update and delete'
,
should_fail
=
1
)
should_fail
=
1
)
def
testMergeInserts
(
self
):
def
testMergeInserts
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
...
@@ -140,7 +140,7 @@ class MappingBase(Base):
...
@@ -140,7 +140,7 @@ class MappingBase(Base):
bm
[
99999
]
=
99999
bm
[
99999
]
=
99999
bm
[
e1
[
2
][
0
]]
=
e1
[
2
][
1
]
bm
[
e1
[
2
][
0
]]
=
e1
[
2
][
1
]
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert'
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert'
)
def
testMergeInsertsFromEmpty
(
self
):
def
testMergeInsertsFromEmpty
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
...
@@ -155,7 +155,7 @@ class MappingBase(Base):
...
@@ -155,7 +155,7 @@ class MappingBase(Base):
bm
.
update
(
e2
)
bm
.
update
(
e2
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
def
testMergeEmptyAndFill
(
self
):
def
testMergeEmptyAndFill
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
...
@@ -165,7 +165,7 @@ class MappingBase(Base):
...
@@ -165,7 +165,7 @@ class MappingBase(Base):
bm
.
update
(
e2
)
bm
.
update
(
e2
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
def
testMergeEmpty
(
self
):
def
testMergeEmpty
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
...
@@ -182,7 +182,7 @@ class MappingBase(Base):
...
@@ -182,7 +182,7 @@ class MappingBase(Base):
b2
[
e1
[
0
][
0
]]
=
e1
[
0
][
1
]
b2
[
e1
[
0
][
0
]]
=
e1
[
0
][
1
]
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge conflicting inserts'
,
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge conflicting inserts'
,
should_fail
=
1
)
should_fail
=
1
)
class
NormalSetTests
(
Base
):
class
NormalSetTests
(
Base
):
""" Test common to all set types """
""" Test common to all set types """
...
@@ -192,7 +192,7 @@ class NormalSetTests(Base):
...
@@ -192,7 +192,7 @@ class NormalSetTests(Base):
class
ExtendedSetTests
(
NormalSetTests
):
class
ExtendedSetTests
(
NormalSetTests
):
"Set (as opposed to TreeSet) specific tests."
"Set (as opposed to TreeSet) specific tests."
def
_setupConflict
(
self
):
def
_setupConflict
(
self
):
l
=
[
-
5124
,
-
7377
,
2274
,
8801
,
-
9901
,
7327
,
1565
,
17
,
-
679
,
l
=
[
-
5124
,
-
7377
,
2274
,
8801
,
-
9901
,
7327
,
1565
,
17
,
-
679
,
3686
,
-
3607
,
14
,
6419
,
-
5637
,
6040
,
-
4556
,
-
8622
,
3847
,
7191
,
3686
,
-
3607
,
14
,
6419
,
-
5637
,
6040
,
-
4556
,
-
8622
,
3847
,
7191
,
-
4067
]
-
4067
]
...
@@ -200,7 +200,7 @@ class ExtendedSetTests(NormalSetTests):
...
@@ -200,7 +200,7 @@ class ExtendedSetTests(NormalSetTests):
e1
=
[
-
1704
,
5420
,
-
239
,
4024
,
-
6984
]
e1
=
[
-
1704
,
5420
,
-
239
,
4024
,
-
6984
]
e2
=
[
7745
,
4868
,
-
2548
,
-
2711
,
-
3154
]
e2
=
[
7745
,
4868
,
-
2548
,
-
2711
,
-
3154
]
base
=
self
.
t
base
=
self
.
t
base
.
update
(
l
)
base
.
update
(
l
)
b1
=
base
.
__class__
(
base
)
b1
=
base
.
__class__
(
base
)
...
@@ -229,7 +229,7 @@ class ExtendedSetTests(NormalSetTests):
...
@@ -229,7 +229,7 @@ class ExtendedSetTests(NormalSetTests):
b2
.
remove
(
items
[
0
])
b2
.
remove
(
items
[
0
])
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge conflicting delete'
,
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge conflicting delete'
,
should_fail
=
1
)
should_fail
=
1
)
def
testMergeInserts
(
self
):
def
testMergeInserts
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
...
@@ -243,7 +243,7 @@ class ExtendedSetTests(NormalSetTests):
...
@@ -243,7 +243,7 @@ class ExtendedSetTests(NormalSetTests):
bm
.
insert
(
99999
)
bm
.
insert
(
99999
)
bm
.
insert
(
e1
[
2
])
bm
.
insert
(
e1
[
2
])
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert'
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert'
)
def
testMergeInsertsFromEmpty
(
self
):
def
testMergeInsertsFromEmpty
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
...
@@ -258,7 +258,7 @@ class ExtendedSetTests(NormalSetTests):
...
@@ -258,7 +258,7 @@ class ExtendedSetTests(NormalSetTests):
bm
.
update
(
e2
)
bm
.
update
(
e2
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
def
testMergeEmptyAndFill
(
self
):
def
testMergeEmptyAndFill
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
...
@@ -268,7 +268,7 @@ class ExtendedSetTests(NormalSetTests):
...
@@ -268,7 +268,7 @@ class ExtendedSetTests(NormalSetTests):
bm
.
update
(
e2
)
bm
.
update
(
e2
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge insert from empty'
)
def
testMergeEmpty
(
self
):
def
testMergeEmpty
(
self
):
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
base
,
b1
,
b2
,
bm
,
e1
,
e2
,
items
=
self
.
_setupConflict
()
...
@@ -285,7 +285,7 @@ class ExtendedSetTests(NormalSetTests):
...
@@ -285,7 +285,7 @@ class ExtendedSetTests(NormalSetTests):
b2
.
insert
(
e1
[
0
])
b2
.
insert
(
e1
[
0
])
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge conflicting inserts'
,
test_merge
(
base
,
b1
,
b2
,
bm
,
'merge conflicting inserts'
,
should_fail
=
1
)
should_fail
=
1
)
def
test_merge
(
o1
,
o2
,
o3
,
expect
,
message
=
'failed to merge'
,
should_fail
=
0
):
def
test_merge
(
o1
,
o2
,
o3
,
expect
,
message
=
'failed to merge'
,
should_fail
=
0
):
s1
=
o1
.
__getstate__
()
s1
=
o1
.
__getstate__
()
...
@@ -304,10 +304,10 @@ def test_merge(o1, o2, o3, expect, message='failed to merge', should_fail=0):
...
@@ -304,10 +304,10 @@ def test_merge(o1, o2, o3, expect, message='failed to merge', should_fail=0):
else
:
else
:
merged
=
o1
.
_p_resolveConflict
(
s1
,
s2
,
s3
)
merged
=
o1
.
_p_resolveConflict
(
s1
,
s2
,
s3
)
assert
merged
==
expected
,
message
assert
merged
==
expected
,
message
class
BucketTests
(
MappingBase
):
class
BucketTests
(
MappingBase
):
""" Tests common to all buckets """
""" Tests common to all buckets """
class
BTreeTests
(
MappingBase
):
class
BTreeTests
(
MappingBase
):
""" Tests common to all BTrees """
""" Tests common to all BTrees """
...
@@ -351,7 +351,7 @@ class TestOISets(ExtendedSetTests, TestCase):
...
@@ -351,7 +351,7 @@ class TestOISets(ExtendedSetTests, TestCase):
class
TestIOTreeSets
(
NormalSetTests
,
TestCase
):
class
TestIOTreeSets
(
NormalSetTests
,
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
t
=
IOTreeSet
()
self
.
t
=
IOTreeSet
()
class
TestOOTreeSets
(
NormalSetTests
,
TestCase
):
class
TestOOTreeSets
(
NormalSetTests
,
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
t
=
OOTreeSet
()
self
.
t
=
OOTreeSet
()
...
@@ -363,7 +363,7 @@ class TestIITreeSets(NormalSetTests, TestCase):
...
@@ -363,7 +363,7 @@ class TestIITreeSets(NormalSetTests, TestCase):
class
TestOITreeSets
(
NormalSetTests
,
TestCase
):
class
TestOITreeSets
(
NormalSetTests
,
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
t
=
OITreeSet
()
self
.
t
=
OITreeSet
()
## Bucket tests
## Bucket tests
class
TestIOBuckets
(
BucketTests
,
TestCase
):
class
TestIOBuckets
(
BucketTests
,
TestCase
):
...
@@ -403,7 +403,7 @@ def test_suite():
...
@@ -403,7 +403,7 @@ def test_suite():
TOOBucket
=
makeSuite
(
TestOOBuckets
,
'test'
)
TOOBucket
=
makeSuite
(
TestOOBuckets
,
'test'
)
TOIBucket
=
makeSuite
(
TestOIBuckets
,
'test'
)
TOIBucket
=
makeSuite
(
TestOIBuckets
,
'test'
)
TIIBucket
=
makeSuite
(
TestIIBuckets
,
'test'
)
TIIBucket
=
makeSuite
(
TestIIBuckets
,
'test'
)
alltests
=
TestSuite
((
TIOSet
,
TOOSet
,
TOISet
,
TIISet
,
alltests
=
TestSuite
((
TIOSet
,
TOOSet
,
TOISet
,
TIISet
,
TIOTreeSet
,
TOOTreeSet
,
TOITreeSet
,
TIITreeSet
,
TIOTreeSet
,
TOOTreeSet
,
TOITreeSet
,
TIITreeSet
,
TIOBucket
,
TOOBucket
,
TOIBucket
,
TIIBucket
,
TIOBucket
,
TOOBucket
,
TOIBucket
,
TIIBucket
,
...
@@ -414,11 +414,11 @@ def test_suite():
...
@@ -414,11 +414,11 @@ def test_suite():
## utility functions
## utility functions
def
lsubtract
(
l1
,
l2
):
def
lsubtract
(
l1
,
l2
):
l1
=
list
(
l1
)
l1
=
list
(
l1
)
l2
=
list
(
l2
)
l2
=
list
(
l2
)
l
=
filter
(
lambda
x
,
l1
=
l1
:
x
not
in
l1
,
l2
)
l
=
filter
(
lambda
x
,
l1
=
l1
:
x
not
in
l1
,
l2
)
l
=
l
+
filter
(
lambda
x
,
l2
=
l2
:
x
not
in
l2
,
l1
)
l
=
l
+
filter
(
lambda
x
,
l2
=
l2
:
x
not
in
l2
,
l1
)
return
l
return
l
def
realseq
(
itemsob
):
def
realseq
(
itemsob
):
return
map
(
lambda
x
:
x
,
itemsob
)
return
map
(
lambda
x
:
x
,
itemsob
)
...
@@ -428,4 +428,3 @@ def main():
...
@@ -428,4 +428,3 @@ def main():
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
main
()
main
()
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