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
f795a954
Commit
f795a954
authored
Nov 12, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test pure-Python OI entities everywhere.
parent
05c4be46
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
167 additions
and
7 deletions
+167
-7
BTrees/check.py
BTrees/check.py
+1
-0
BTrees/tests/test_OIBTree.py
BTrees/tests/test_OIBTree.py
+166
-7
No files found.
BTrees/check.py
View file @
f795a954
...
@@ -35,6 +35,7 @@ that doesn't exist in the actual BTree).
...
@@ -35,6 +35,7 @@ that doesn't exist in the actual BTree).
from
BTrees.OOBTree
import
OOBTree
,
OOBucket
,
OOSet
,
OOTreeSet
from
BTrees.OOBTree
import
OOBTree
,
OOBucket
,
OOSet
,
OOTreeSet
from
BTrees.OOBTree
import
OOBTreePy
,
OOBucketPy
,
OOSetPy
,
OOTreeSetPy
from
BTrees.OOBTree
import
OOBTreePy
,
OOBucketPy
,
OOSetPy
,
OOTreeSetPy
from
BTrees.OIBTree
import
OIBTree
,
OIBucket
,
OISet
,
OITreeSet
from
BTrees.OIBTree
import
OIBTree
,
OIBucket
,
OISet
,
OITreeSet
from
BTrees.OIBTree
import
OIBTreePy
,
OIBucketPy
,
OISetPy
,
OITreeSetPy
from
BTrees.IOBTree
import
IOBTree
,
IOBucket
,
IOSet
,
IOTreeSet
from
BTrees.IOBTree
import
IOBTree
,
IOBucket
,
IOSet
,
IOTreeSet
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
,
IISet
,
IITreeSet
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
,
IISet
,
IITreeSet
from
BTrees.IFBTree
import
IFBTree
,
IFBucket
,
IFSet
,
IFTreeSet
from
BTrees.IFBTree
import
IFBTree
,
IFBucket
,
IFSet
,
IFTreeSet
...
...
BTrees/tests/test_OIBTree.py
View file @
f795a954
...
@@ -38,6 +38,13 @@ class OIBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
...
@@ -38,6 +38,13 @@ class OIBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return
OIBTree
return
OIBTree
class
OIBTreePyInternalKeyTest
(
InternalKeysMappingTest
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OIBTree
import
OIBTreePy
return
OIBTreePy
class
OITreeSetInternalKeyTest
(
InternalKeysSetTest
,
unittest
.
TestCase
):
class
OITreeSetInternalKeyTest
(
InternalKeysSetTest
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
def
_getTargetClass
(
self
):
...
@@ -45,6 +52,13 @@ class OITreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
...
@@ -45,6 +52,13 @@ class OITreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
return
OITreeSet
return
OITreeSet
class
OITreeSetPyInternalKeyTest
(
InternalKeysSetTest
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OIBTree
import
OITreeSetPy
return
OITreeSetPy
class
OIBucketTest
(
MappingBase
,
unittest
.
TestCase
):
class
OIBucketTest
(
MappingBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
def
_getTargetClass
(
self
):
...
@@ -52,6 +66,13 @@ class OIBucketTest(MappingBase, unittest.TestCase):
...
@@ -52,6 +66,13 @@ class OIBucketTest(MappingBase, unittest.TestCase):
return
OIBucket
return
OIBucket
class
OIBucketPyTest
(
MappingBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OIBTree
import
OIBucketPy
return
OIBucketPy
class
OITreeSetTest
(
NormalSetTests
,
unittest
.
TestCase
):
class
OITreeSetTest
(
NormalSetTests
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
def
_getTargetClass
(
self
):
...
@@ -59,6 +80,13 @@ class OITreeSetTest(NormalSetTests, unittest.TestCase):
...
@@ -59,6 +80,13 @@ class OITreeSetTest(NormalSetTests, unittest.TestCase):
return
OITreeSet
return
OITreeSet
class
OITreeSetPyTest
(
NormalSetTests
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OIBTree
import
OITreeSetPy
return
OITreeSetPy
class
OISetTest
(
ExtendedSetTests
,
unittest
.
TestCase
):
class
OISetTest
(
ExtendedSetTests
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
def
_getTargetClass
(
self
):
...
@@ -66,6 +94,13 @@ class OISetTest(ExtendedSetTests, unittest.TestCase):
...
@@ -66,6 +94,13 @@ class OISetTest(ExtendedSetTests, unittest.TestCase):
return
OISet
return
OISet
class
OISetPyTest
(
ExtendedSetTests
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OIBTree
import
OISetPy
return
OISetPy
class
OIBTreeTest
(
BTreeTests
,
unittest
.
TestCase
):
class
OIBTreeTest
(
BTreeTests
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
def
_makeOne
(
self
):
...
@@ -73,10 +108,10 @@ class OIBTreeTest(BTreeTests, unittest.TestCase):
...
@@ -73,10 +108,10 @@ class OIBTreeTest(BTreeTests, unittest.TestCase):
return
OIBTree
()
return
OIBTree
()
class
OIBTreeTest
(
BTreeTests
,
unittest
.
TestCase
):
class
OIBTree
Py
Test
(
BTreeTests
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
def
_makeOne
(
self
):
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBTree
Py
return
OIBTree
()
return
OIBTree
Py
()
if
using64bits
:
if
using64bits
:
...
@@ -88,10 +123,15 @@ if using64bits:
...
@@ -88,10 +123,15 @@ if using64bits:
def
getTwoKeys
(
self
):
def
getTwoKeys
(
self
):
return
object
(),
object
()
return
object
(),
object
()
class
TestOIBTrees
(
TypeTest
,
unittest
.
TestCase
):
class
OIBTreePyTest
(
BTreeTests
,
TestLongIntValues
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
def
_makeOne
(
self
):
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBTreePy
return
OIBTree
()
return
OIBTreePy
()
def
getTwoKeys
(
self
):
return
object
(),
object
()
class
_TestOIBTreesBase
(
TypeTest
):
def
_stringraises
(
self
):
def
_stringraises
(
self
):
self
.
_makeOne
()[
1
]
=
'c'
self
.
_makeOne
()[
1
]
=
'c'
...
@@ -113,16 +153,34 @@ class TestOIBTrees(TypeTest, unittest.TestCase):
...
@@ -113,16 +153,34 @@ class TestOIBTrees(TypeTest, unittest.TestCase):
self
.
assertEqual
(
b
.
keys
()[
0
],
30
)
self
.
assertEqual
(
b
.
keys
()[
0
],
30
)
class
TestOIBTrees
(
_TestOIBTreesBase
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
from
BTrees.OIBTree
import
OIBTree
return
OIBTree
()
class
TestOIBTreesPy
(
_TestOIBTreesBase
,
unittest
.
TestCase
):
def
_makeOne
(
self
):
from
BTrees.OIBTree
import
OIBTreePy
return
OIBTreePy
()
class
PureOI
(
SetResult
,
unittest
.
TestCase
):
class
PureOI
(
SetResult
,
unittest
.
TestCase
):
def
union
(
self
,
*
args
):
def
union
(
self
,
*
args
):
from
BTrees.OIBTree
import
union
from
BTrees.OIBTree
import
union
return
union
(
*
args
)
return
union
(
*
args
)
def
intersection
(
self
,
*
args
):
def
intersection
(
self
,
*
args
):
from
BTrees.OIBTree
import
intersection
from
BTrees.OIBTree
import
intersection
return
intersection
(
*
args
)
return
intersection
(
*
args
)
def
difference
(
self
,
*
args
):
def
difference
(
self
,
*
args
):
from
BTrees.OIBTree
import
difference
from
BTrees.OIBTree
import
difference
return
difference
(
*
args
)
return
difference
(
*
args
)
def
builders
(
self
):
def
builders
(
self
):
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBucket
from
BTrees.OIBTree
import
OIBucket
...
@@ -131,22 +189,51 @@ class PureOI(SetResult, unittest.TestCase):
...
@@ -131,22 +189,51 @@ class PureOI(SetResult, unittest.TestCase):
return
OISet
,
OITreeSet
,
makeBuilder
(
OIBTree
),
makeBuilder
(
OIBucket
)
return
OISet
,
OITreeSet
,
makeBuilder
(
OIBTree
),
makeBuilder
(
OIBucket
)
class
PureOIPy
(
SetResult
,
unittest
.
TestCase
):
def
union
(
self
,
*
args
):
from
BTrees.OIBTree
import
unionPy
return
unionPy
(
*
args
)
def
intersection
(
self
,
*
args
):
from
BTrees.OIBTree
import
intersectionPy
return
intersectionPy
(
*
args
)
def
difference
(
self
,
*
args
):
from
BTrees.OIBTree
import
differencePy
return
differencePy
(
*
args
)
def
builders
(
self
):
from
BTrees.OIBTree
import
OIBTreePy
from
BTrees.OIBTree
import
OIBucketPy
from
BTrees.OIBTree
import
OITreeSetPy
from
BTrees.OIBTree
import
OISetPy
return
(
OISetPy
,
OITreeSetPy
,
makeBuilder
(
OIBTreePy
),
makeBuilder
(
OIBucketPy
))
class
TestWeightedOI
(
Weighted
,
unittest
.
TestCase
):
class
TestWeightedOI
(
Weighted
,
unittest
.
TestCase
):
def
weightedUnion
(
self
):
def
weightedUnion
(
self
):
from
BTrees.OIBTree
import
weightedUnion
from
BTrees.OIBTree
import
weightedUnion
return
weightedUnion
return
weightedUnion
def
weightedIntersection
(
self
):
def
weightedIntersection
(
self
):
from
BTrees.OIBTree
import
weightedIntersection
from
BTrees.OIBTree
import
weightedIntersection
return
weightedIntersection
return
weightedIntersection
def
union
(
self
):
def
union
(
self
):
from
BTrees.OIBTree
import
union
from
BTrees.OIBTree
import
union
return
union
return
union
def
intersection
(
self
):
def
intersection
(
self
):
from
BTrees.OIBTree
import
intersection
from
BTrees.OIBTree
import
intersection
return
intersection
return
intersection
def
mkbucket
(
self
,
*
args
):
def
mkbucket
(
self
,
*
args
):
from
BTrees.OIBTree
import
OIBucket
as
mkbucket
from
BTrees.OIBTree
import
OIBucket
as
mkbucket
return
mkbucket
(
*
args
)
return
mkbucket
(
*
args
)
def
builders
(
self
):
def
builders
(
self
):
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBTree
from
BTrees.OIBTree
import
OIBucket
from
BTrees.OIBTree
import
OIBucket
...
@@ -155,6 +242,37 @@ class TestWeightedOI(Weighted, unittest.TestCase):
...
@@ -155,6 +242,37 @@ class TestWeightedOI(Weighted, unittest.TestCase):
return
OIBucket
,
OIBTree
,
itemsToSet
(
OISet
),
itemsToSet
(
OITreeSet
)
return
OIBucket
,
OIBTree
,
itemsToSet
(
OISet
),
itemsToSet
(
OITreeSet
)
class
TestWeightedOIPy
(
Weighted
,
unittest
.
TestCase
):
def
weightedUnion
(
self
):
from
BTrees.OIBTree
import
weightedUnionPy
return
weightedUnionPy
def
weightedIntersection
(
self
):
from
BTrees.OIBTree
import
weightedIntersectionPy
return
weightedIntersectionPy
def
union
(
self
):
from
BTrees.OIBTree
import
unionPy
return
unionPy
def
intersection
(
self
):
from
BTrees.OIBTree
import
intersectionPy
return
intersectionPy
def
mkbucket
(
self
,
*
args
):
from
BTrees.OIBTree
import
OIBucketPy
as
mkbucket
return
mkbucket
(
*
args
)
def
builders
(
self
):
from
BTrees.OIBTree
import
OIBTreePy
from
BTrees.OIBTree
import
OIBucketPy
from
BTrees.OIBTree
import
OITreeSetPy
from
BTrees.OIBTree
import
OISetPy
return
(
OIBucketPy
,
OIBTreePy
,
itemsToSet
(
OISetPy
),
itemsToSet
(
OITreeSetPy
))
class
OIBucketConflictTests
(
MappingConflictTestBase
,
unittest
.
TestCase
):
class
OIBucketConflictTests
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
def
_getTargetClass
(
self
):
...
@@ -162,6 +280,13 @@ class OIBucketConflictTests(MappingConflictTestBase, unittest.TestCase):
...
@@ -162,6 +280,13 @@ class OIBucketConflictTests(MappingConflictTestBase, unittest.TestCase):
return
OIBucket
return
OIBucket
class
OIBucketConflictTestsPy
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OIBTree
import
OIBucketPy
return
OIBucketPy
class
OISetConflictTests
(
SetConflictTestBase
,
unittest
.
TestCase
):
class
OISetConflictTests
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
def
_getTargetClass
(
self
):
...
@@ -169,6 +294,13 @@ class OISetConflictTests(SetConflictTestBase, unittest.TestCase):
...
@@ -169,6 +294,13 @@ class OISetConflictTests(SetConflictTestBase, unittest.TestCase):
return
OISet
return
OISet
class
OISetConflictTestsPy
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OIBTree
import
OISetPy
return
OISetPy
class
OIBTreeConflictTests
(
MappingConflictTestBase
,
unittest
.
TestCase
):
class
OIBTreeConflictTests
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
def
_getTargetClass
(
self
):
...
@@ -176,6 +308,13 @@ class OIBTreeConflictTests(MappingConflictTestBase, unittest.TestCase):
...
@@ -176,6 +308,13 @@ class OIBTreeConflictTests(MappingConflictTestBase, unittest.TestCase):
return
OIBTree
return
OIBTree
class
OIBTreeConflictTestsPy
(
MappingConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OIBTree
import
OIBTreePy
return
OIBTreePy
class
OITreeSetConflictTests
(
SetConflictTestBase
,
unittest
.
TestCase
):
class
OITreeSetConflictTests
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
def
_getTargetClass
(
self
):
...
@@ -183,6 +322,13 @@ class OITreeSetConflictTests(SetConflictTestBase, unittest.TestCase):
...
@@ -183,6 +322,13 @@ class OITreeSetConflictTests(SetConflictTestBase, unittest.TestCase):
return
OITreeSet
return
OITreeSet
class
OITreeSetConflictTestsPy
(
SetConflictTestBase
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
BTrees.OIBTree
import
OITreeSetPy
return
OITreeSetPy
class
OIModuleTest
(
ModuleTest
,
unittest
.
TestCase
):
class
OIModuleTest
(
ModuleTest
,
unittest
.
TestCase
):
prefix
=
'OI'
prefix
=
'OI'
...
@@ -207,17 +353,30 @@ class OIModuleTest(ModuleTest, unittest.TestCase):
...
@@ -207,17 +353,30 @@ class OIModuleTest(ModuleTest, unittest.TestCase):
def
test_suite
():
def
test_suite
():
return
unittest
.
TestSuite
((
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
OIBTreeInternalKeyTest
),
unittest
.
makeSuite
(
OIBTreeInternalKeyTest
),
unittest
.
makeSuite
(
OIBTreePyInternalKeyTest
),
unittest
.
makeSuite
(
OITreeSetInternalKeyTest
),
unittest
.
makeSuite
(
OITreeSetInternalKeyTest
),
unittest
.
makeSuite
(
OITreeSetPyInternalKeyTest
),
unittest
.
makeSuite
(
OIBucketTest
),
unittest
.
makeSuite
(
OIBucketTest
),
unittest
.
makeSuite
(
OIBucketPyTest
),
unittest
.
makeSuite
(
OITreeSetTest
),
unittest
.
makeSuite
(
OITreeSetTest
),
unittest
.
makeSuite
(
OITreeSetPyTest
),
unittest
.
makeSuite
(
OISetTest
),
unittest
.
makeSuite
(
OISetTest
),
unittest
.
makeSuite
(
OISetPyTest
),
unittest
.
makeSuite
(
OIBTreeTest
),
unittest
.
makeSuite
(
OIBTreeTest
),
unittest
.
makeSuite
(
OIBTreePyTest
),
unittest
.
makeSuite
(
TestOIBTrees
),
unittest
.
makeSuite
(
TestOIBTrees
),
unittest
.
makeSuite
(
TestOIBTreesPy
),
unittest
.
makeSuite
(
PureOI
),
unittest
.
makeSuite
(
PureOI
),
unittest
.
makeSuite
(
PureOIPy
),
unittest
.
makeSuite
(
TestWeightedOI
),
unittest
.
makeSuite
(
TestWeightedOI
),
unittest
.
makeSuite
(
TestWeightedOIPy
),
unittest
.
makeSuite
(
OIBucketConflictTests
),
unittest
.
makeSuite
(
OIBucketConflictTests
),
unittest
.
makeSuite
(
OIBucketConflictTestsPy
),
unittest
.
makeSuite
(
OISetConflictTests
),
unittest
.
makeSuite
(
OISetConflictTests
),
unittest
.
makeSuite
(
OISetConflictTestsPy
),
unittest
.
makeSuite
(
OIBTreeConflictTests
),
unittest
.
makeSuite
(
OIBTreeConflictTests
),
unittest
.
makeSuite
(
OIBTreeConflictTestsPy
),
unittest
.
makeSuite
(
OITreeSetConflictTests
),
unittest
.
makeSuite
(
OITreeSetConflictTests
),
unittest
.
makeSuite
(
OITreeSetConflictTestsPy
),
unittest
.
makeSuite
(
OIModuleTest
),
unittest
.
makeSuite
(
OIModuleTest
),
))
))
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