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
47c2706e
Commit
47c2706e
authored
Feb 17, 2001
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checked in some more typing tests for sets and buckets.
parent
06cf5863
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
7 deletions
+58
-7
src/BTrees/tests/testBTrees.py
src/BTrees/tests/testBTrees.py
+58
-7
No files found.
src/BTrees/tests/testBTrees.py
View file @
47c2706e
...
...
@@ -95,7 +95,9 @@ from BTrees.OOBTree import OOBTree, OOBucket, OOSet, OOTreeSet
from
BTrees.IOBTree
import
IOBTree
,
IOBucket
,
IOSet
,
IOTreeSet
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
,
IISet
,
IITreeSet
from
BTrees.OIBTree
import
OIBTree
,
OIBucket
,
OISet
,
OITreeSet
from
unittest
import
TestCase
,
TestSuite
,
TextTestRunner
,
makeSuite
from
unittest
import
TestCase
,
TestSuite
,
JUnitTextTestRunner
,
VerboseTextTestRunner
,
makeSuite
TextTestRunner
=
VerboseTextTestRunner
class
Base
:
""" Tests common to all types: sets, buckets, and BTrees """
...
...
@@ -574,7 +576,6 @@ class BTreeTests(MappingBase):
assert
t
.
insert
(
1
,
1
)
==
1
assert
lsubtract
(
list
(
t
.
keys
()),
[
0
,
1
])
==
[]
## BTree tests
class
TestIOBTrees
(
BTreeTests
,
TestCase
):
...
...
@@ -584,6 +585,7 @@ class TestIOBTrees(BTreeTests, TestCase):
def
nonIntegerKeyRaises
(
self
):
self
.
assertRaises
(
TypeError
,
self
.
_stringraises
)
self
.
assertRaises
(
TypeError
,
self
.
_floatraises
)
self
.
assertRaises
(
TypeError
,
self
.
_noneraises
)
def
_stringraises
(
self
):
self
.
t
[
'c'
]
=
1
...
...
@@ -591,6 +593,9 @@ class TestIOBTrees(BTreeTests, TestCase):
def
_floatraises
(
self
):
self
.
t
[
2.5
]
=
1
def
_noneraises
(
self
):
self
.
t
[
None
]
=
1
class
TestOOBTrees
(
BTreeTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
OOBTree
()
...
...
@@ -599,26 +604,72 @@ class TestOIBTrees(BTreeTests, TestCase):
def
setUp
(
self
):
self
.
t
=
OIBTree
()
def
testNonIntegerValueRaises
(
self
):
self
.
assertRaises
(
TypeError
,
self
.
_stringraises
)
self
.
assertRaises
(
TypeError
,
self
.
_floatraises
)
self
.
assertRaises
(
TypeError
,
self
.
_noneraises
)
def
_stringraises
(
self
):
self
.
t
[
1
]
=
'c'
def
_floatraises
(
self
):
self
.
t
[
1
]
=
1.4
def
_noneraises
(
self
):
self
.
t
[
1
]
=
None
class
TestIIBTrees
(
BTreeTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
IIBTree
()
def
nonIntegerKeyRaises
(
self
):
self
.
assertRaises
(
TypeError
,
self
.
_stringraises
)
self
.
assertRaises
(
TypeError
,
self
.
_floatraises
)
def
testNonIntegerKeyRaises
(
self
):
self
.
assertRaises
(
TypeError
,
self
.
_stringraiseskey
)
self
.
assertRaises
(
TypeError
,
self
.
_floatraiseskey
)
self
.
assertRaises
(
TypeError
,
self
.
_noneraiseskey
)
def
_stringraises
(
self
):
def
testNonIntegerValueRaises
(
self
):
self
.
assertRaises
(
TypeError
,
self
.
_stringraisesvalue
)
self
.
assertRaises
(
TypeError
,
self
.
_floatraisesvalue
)
self
.
assertRaises
(
TypeError
,
self
.
_noneraisesvalue
)
def
_stringraiseskey
(
self
):
self
.
t
[
'c'
]
=
1
def
_floatraises
(
self
):
def
_floatraises
key
(
self
):
self
.
t
[
2.5
]
=
1
def
_noneraiseskey
(
self
):
self
.
t
[
None
]
=
1
def
_stringraisesvalue
(
self
):
self
.
t
[
1
]
=
'c'
def
_floatraisesvalue
(
self
):
self
.
t
[
1
]
=
1.4
def
_noneraisesvalue
(
self
):
self
.
t
[
1
]
=
None
## Set tests
class
TestIOSets
(
ExtendedSetTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
IOSet
()
def
testNonIntegerInsertRaises
(
self
):
self
.
assertRaises
(
TypeError
,
self
.
_insertstringraises
)
self
.
assertRaises
(
TypeError
,
self
.
_insertfloatraises
)
self
.
assertRaises
(
TypeError
,
self
.
_insertnoneraises
)
def
_insertstringraises
(
self
):
self
.
t
.
insert
(
'a'
)
def
_insertfloatraises
(
self
):
self
.
t
.
insert
(
1.4
)
def
_insertnoneraises
(
self
):
self
.
t
.
insert
(
None
)
class
TestOOSets
(
ExtendedSetTests
,
TestCase
):
def
setUp
(
self
):
self
.
t
=
OOSet
()
...
...
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