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
1fc6edb9
Commit
1fc6edb9
authored
Dec 12, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove pseudo-tests which only tested language semantics.
parent
9d0747e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
76 deletions
+0
-76
BTrees/tests/test_compare.py
BTrees/tests/test_compare.py
+0
-76
No files found.
BTrees/tests/test_compare.py
deleted
100644 → 0
View file @
9d0747e5
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Test errors during comparison of BTree keys."""
import
unittest
from
.._compat
import
_u
STR
=
"A string with hi-bit-set characters:
\
700
\
701
"
UNICODE
=
_u
(
"A unicode string"
)
class
CompareTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
# These defaults only make sense if the default encoding
# prevents STR from being promoted to Unicode.
self
.
assertRaises
(
UnicodeError
,
unicode
,
STR
)
def
_makeBucket
(
self
):
from
BTrees.OOBTree
import
OOBucket
return
OOBucket
()
def
_makeSet
(
self
):
from
BTrees.OOBTree
import
OOSet
return
OOSet
()
def
assertUE
(
self
,
callable
,
*
args
):
self
.
assertRaises
(
UnicodeError
,
callable
,
*
args
)
def
testBucketGet
(
self
):
import
warnings
b
=
self
.
_makeBucket
()
with
warnings
.
catch_warnings
(
True
)
as
_warnlog
:
b
[
STR
]
=
1
self
.
assertUE
(
b
.
get
,
UNICODE
)
self
.
assertEqual
(
len
(
_warnlog
),
1
)
def
testSetGet
(
self
):
s
=
self
.
_makeSet
()
s
.
insert
(
STR
)
self
.
assertUE
(
s
.
remove
,
UNICODE
)
def
testBucketSet
(
self
):
b
=
self
.
_makeBucket
()
b
[
STR
]
=
1
self
.
assertUE
(
b
.
__setitem__
,
UNICODE
,
1
)
def
testSetSet
(
self
):
s
=
self
.
_makeSet
()
s
.
insert
(
STR
)
self
.
assertUE
(
s
.
insert
,
UNICODE
)
def
testBucketMinKey
(
self
):
b
=
self
.
_makeBucket
()
b
[
STR
]
=
1
self
.
assertUE
(
b
.
minKey
,
UNICODE
)
def
testSetMinKey
(
self
):
s
=
self
.
_makeSet
()
s
.
insert
(
STR
)
self
.
assertUE
(
s
.
minKey
,
UNICODE
)
def
test_suite
():
return
unittest
.
makeSuite
(
CompareTest
)
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