Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
0a20d058
Commit
0a20d058
authored
Oct 15, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added unittest to check for broken btree implementation with unicode
strings as keys
parent
8d893238
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
src/BTrees/tests/testBTreesUnicode.py
src/BTrees/tests/testBTreesUnicode.py
+45
-0
No files found.
src/BTrees/tests/testBTreesUnicode.py
0 → 100644
View file @
0a20d058
import
os
,
sys
,
unittest
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
from
BTrees.OOBTree
import
OOBTree
class
TestBTreesUnicode
(
unittest
.
TestCase
):
""" test unicode"""
def
setUp
(
self
):
""" setup an OOBTree with some unicode strings """
self
.
s
=
unicode
(
'dreit
\
xe4
gigen'
,
'latin1'
)
self
.
data
=
[(
'alien'
,
284708388
),
(
'fox'
,
284708387
),
(
'future'
,
284708388
),
(
'k
\
xf6
nnten'
,
284708389
),
(
'quick'
,
284708387
),
(
'zerst
\
xf6
rt'
,
284708389
),
(
unicode
(
'dreit
\
xe4
gigen'
,
'latin1'
),
284708391
)]
self
.
tree
=
OOBTree
()
for
k
,
v
in
self
.
data
:
self
.
tree
[
k
]
=
v
def
test1
(
self
):
""" check every item of the tree """
for
k
,
v
in
self
.
data
:
assert
self
.
tree
[
k
]
==
v
def
test2
(
self
):
""" try to access unicode keys in tree"""
assert
self
.
data
[
-
1
][
0
]
==
self
.
s
assert
self
.
tree
[
self
.
data
[
-
1
][
0
]]
==
self
.
data
[
-
1
][
1
]
assert
self
.
tree
[
self
.
s
]
==
self
.
data
[
-
1
][
1
]
def
test_suite
():
return
unittest
.
makeSuite
(
TestBTreesUnicode
,
'test'
)
framework
()
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