Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BTrees
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
BTrees
Commits
5d675dc0
Commit
5d675dc0
authored
Nov 11, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move OI/OO-related set-op tests into OI/OO test modules.
parent
60352f47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
78 deletions
+87
-78
BTrees/tests/testSetOps.py
BTrees/tests/testSetOps.py
+0
-62
BTrees/tests/test_OIBTree.py
BTrees/tests/test_OIBTree.py
+58
-9
BTrees/tests/test_OOBTree.py
BTrees/tests/test_OOBTree.py
+29
-7
No files found.
BTrees/tests/testSetOps.py
View file @
5d675dc0
...
...
@@ -19,40 +19,6 @@ from .common import Weighted
from
.common
import
itemsToSet
from
.common
import
makeBuilder
class
PureOO
(
SetResult
,
unittest
.
TestCase
):
def
union
(
self
,
*
args
):
from
BTrees.OOBTree
import
union
return
union
(
*
args
)
def
intersection
(
self
,
*
args
):
from
BTrees.OOBTree
import
intersection
return
intersection
(
*
args
)
def
difference
(
self
,
*
args
):
from
BTrees.OOBTree
import
difference
return
difference
(
*
args
)
def
builders
(
self
):
from
BTrees.OOBTree
import
OOBTree
from
BTrees.OOBTree
import
OOBucket
from
BTrees.OOBTree
import
OOTreeSet
from
BTrees.OOBTree
import
OOSet
return
OOSet
,
OOTreeSet
,
makeBuilder
(
OOBTree
),
makeBuilder
(
OOBucket
)
class
PureOI
(
SetResult
,
unittest
.
TestCase
):
def
union
(
self
,
*
args
):
from
BTrees.OIBTree
import
union
return
union
(
*
args
)
def
intersection
(
self
,
*
args
):
from
BTrees.OIBTree
import
intersection
return
intersection
(
*
args
)
def
difference
(
self
,
*
args
):
from
BTrees.OIBTree
import
difference
return
difference
(
*
args
)
def
builders
(
self
):
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBucket
from
BTrees.OIBTree
import
OITreeSet
from
BTrees.OIBTree
import
OISet
return
OISet
,
OITreeSet
,
makeBuilder
(
OIBTree
),
makeBuilder
(
OIBucket
)
class
PureOL
(
SetResult
,
unittest
.
TestCase
):
def
union
(
self
,
*
args
):
from
BTrees.OLBTree
import
union
...
...
@@ -157,29 +123,6 @@ class TestImports(unittest.TestCase):
else
:
self
.
fail
(
"OOBTree shouldn't have multiunion"
)
class
TestWeightedOI
(
Weighted
,
unittest
.
TestCase
):
def
weightedUnion
(
self
):
from
BTrees.OIBTree
import
weightedUnion
return
weightedUnion
def
weightedIntersection
(
self
):
from
BTrees.OIBTree
import
weightedIntersection
return
weightedIntersection
def
union
(
self
):
from
BTrees.OIBTree
import
union
return
union
def
intersection
(
self
):
from
BTrees.OIBTree
import
intersection
return
intersection
def
mkbucket
(
self
,
*
args
):
from
BTrees.OIBTree
import
OIBucket
as
mkbucket
return
mkbucket
(
*
args
)
def
builders
(
self
):
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBucket
from
BTrees.OIBTree
import
OITreeSet
from
BTrees.OIBTree
import
OISet
return
OIBucket
,
OIBTree
,
itemsToSet
(
OISet
),
itemsToSet
(
OITreeSet
)
class
TestWeightedOL
(
Weighted
,
unittest
.
TestCase
):
def
weightedUnion
(
self
):
from
BTrees.OLBTree
import
weightedUnion
...
...
@@ -207,11 +150,6 @@ class TestWeightedOL(Weighted, unittest.TestCase):
def
test_suite
():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
PureOO
),
unittest
.
makeSuite
(
PureOI
),
unittest
.
makeSuite
(
TestWeightedOI
),
unittest
.
makeSuite
(
PureOL
),
unittest
.
makeSuite
(
TestWeightedOL
),
...
...
BTrees/tests/test_OIBTree.py
View file @
5d675dc0
...
...
@@ -13,15 +13,19 @@
##############################################################################
import
unittest
from
BTrees.tests.common
import
BTreeTests
from
BTrees.tests.common
import
ExtendedSetTests
from
BTrees.tests.common
import
InternalKeysMappingTest
from
BTrees.tests.common
import
InternalKeysSetTest
from
BTrees.tests.common
import
MappingBase
from
BTrees.tests.common
import
ModuleTest
from
BTrees.tests.common
import
NormalSetTests
from
BTrees.tests.common
import
TestLongIntValues
from
BTrees.tests.common
import
TypeTest
from
.common
import
BTreeTests
from
.common
import
ExtendedSetTests
from
.common
import
InternalKeysMappingTest
from
.common
import
InternalKeysSetTest
from
.common
import
MappingBase
from
.common
import
ModuleTest
from
.common
import
NormalSetTests
from
.common
import
SetResult
from
.common
import
TestLongIntValues
from
.common
import
TypeTest
from
.common
import
Weighted
from
.common
import
itemsToSet
from
.common
import
makeBuilder
from
BTrees.IIBTree
import
using64bits
#XXX Ugly, but necessary
...
...
@@ -120,6 +124,48 @@ class TestOIBTrees(TypeTest, unittest.TestCase):
self
.
assertEqual
(
b
.
keys
()[
0
],
30
)
class
PureOI
(
SetResult
,
unittest
.
TestCase
):
def
union
(
self
,
*
args
):
from
BTrees.OIBTree
import
union
return
union
(
*
args
)
def
intersection
(
self
,
*
args
):
from
BTrees.OIBTree
import
intersection
return
intersection
(
*
args
)
def
difference
(
self
,
*
args
):
from
BTrees.OIBTree
import
difference
return
difference
(
*
args
)
def
builders
(
self
):
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBucket
from
BTrees.OIBTree
import
OITreeSet
from
BTrees.OIBTree
import
OISet
return
OISet
,
OITreeSet
,
makeBuilder
(
OIBTree
),
makeBuilder
(
OIBucket
)
class
TestWeightedOI
(
Weighted
,
unittest
.
TestCase
):
def
weightedUnion
(
self
):
from
BTrees.OIBTree
import
weightedUnion
return
weightedUnion
def
weightedIntersection
(
self
):
from
BTrees.OIBTree
import
weightedIntersection
return
weightedIntersection
def
union
(
self
):
from
BTrees.OIBTree
import
union
return
union
def
intersection
(
self
):
from
BTrees.OIBTree
import
intersection
return
intersection
def
mkbucket
(
self
,
*
args
):
from
BTrees.OIBTree
import
OIBucket
as
mkbucket
return
mkbucket
(
*
args
)
def
builders
(
self
):
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBucket
from
BTrees.OIBTree
import
OITreeSet
from
BTrees.OIBTree
import
OISet
return
OIBucket
,
OIBTree
,
itemsToSet
(
OISet
),
itemsToSet
(
OITreeSet
)
def
test_suite
():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
OIBTreeInternalKeyTest
),
...
...
@@ -130,4 +176,7 @@ def test_suite():
unittest
.
makeSuite
(
OIModuleTest
),
unittest
.
makeSuite
(
OIBTreeTest
),
unittest
.
makeSuite
(
TestOIBTrees
),
unittest
.
makeSuite
(
PureOI
),
unittest
.
makeSuite
(
TestWeightedOI
),
))
BTrees/tests/test_OOBTree.py
View file @
5d675dc0
...
...
@@ -13,13 +13,15 @@
##############################################################################
import
unittest
from
BTrees.tests.common
import
BTreeTests
from
BTrees.tests.common
import
ExtendedSetTests
from
BTrees.tests.common
import
InternalKeysMappingTest
from
BTrees.tests.common
import
InternalKeysSetTest
from
BTrees.tests.common
import
MappingBase
from
BTrees.tests.common
import
ModuleTest
from
BTrees.tests.common
import
NormalSetTests
from
.common
import
BTreeTests
from
.common
import
ExtendedSetTests
from
.common
import
InternalKeysMappingTest
from
.common
import
InternalKeysSetTest
from
.common
import
MappingBase
from
.common
import
ModuleTest
from
.common
import
NormalSetTests
from
.common
import
SetResult
from
.common
import
makeBuilder
class
OOBTreeInternalKeyTest
(
InternalKeysMappingTest
,
unittest
.
TestCase
):
...
...
@@ -157,6 +159,24 @@ class OOModuleTest(ModuleTest, unittest.TestCase):
return
BTrees
.
Interfaces
.
IObjectObjectBTreeModule
class
PureOO
(
SetResult
,
unittest
.
TestCase
):
def
union
(
self
,
*
args
):
from
BTrees.OOBTree
import
union
return
union
(
*
args
)
def
intersection
(
self
,
*
args
):
from
BTrees.OOBTree
import
intersection
return
intersection
(
*
args
)
def
difference
(
self
,
*
args
):
from
BTrees.OOBTree
import
difference
return
difference
(
*
args
)
def
builders
(
self
):
from
BTrees.OOBTree
import
OOBTree
from
BTrees.OOBTree
import
OOBucket
from
BTrees.OOBTree
import
OOTreeSet
from
BTrees.OOBTree
import
OOSet
return
OOSet
,
OOTreeSet
,
makeBuilder
(
OOBTree
),
makeBuilder
(
OOBucket
)
def
test_suite
():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
OOBTreeInternalKeyTest
),
...
...
@@ -173,4 +193,6 @@ def test_suite():
unittest
.
makeSuite
(
OOBTreeTest
),
unittest
.
makeSuite
(
OOBTreePyTest
),
unittest
.
makeSuite
(
OOModuleTest
),
unittest
.
makeSuite
(
PureOO
),
))
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