[Zodb-checkins] CVS: ZODB4/src/zodb/btrees/tests - test_unicode.py:1.3
Barry Warsaw
barry@wooz.org
Thu, 13 Mar 2003 17:12:05 -0500
Update of /cvs-repository/ZODB4/src/zodb/btrees/tests
In directory cvs.zope.org:/tmp/cvs-serv922/src/zodb/btrees/tests
Modified Files:
test_unicode.py
Log Message:
Eradicate the types module in ZODB (where possible). Also normalize
on isinstance() instead of type comparisons.
=== ZODB4/src/zodb/btrees/tests/test_unicode.py 1.2 => 1.3 ===
--- ZODB4/src/zodb/btrees/tests/test_unicode.py:1.2 Wed Dec 25 09:12:17 2002
+++ ZODB4/src/zodb/btrees/tests/test_unicode.py Thu Mar 13 17:11:34 2003
@@ -13,7 +13,6 @@
##############################################################################
__version__ = '$Id$'
-import types
import unittest
from zodb.btrees.OOBTree import OOBTree
@@ -43,14 +42,14 @@
self.tree = OOBTree()
for k, v in self.data:
- if isinstance(k, types.StringType):
+ if isinstance(k, str):
k = unicode(k, 'latin1')
self.tree[k] = v
def testAllKeys(self):
# check every item of the tree
for k, v in self.data:
- if isinstance(k, types.StringType):
+ if isinstance(k, str):
k = unicode(k, encoding)
self.assert_(self.tree.has_key(k))
self.assertEqual(self.tree[k], v)
@@ -65,7 +64,7 @@
def testAsciiKeys(self):
# try to access some "plain ASCII" keys in the tree
for k, v in self.data[0], self.data[2]:
- self.assert_(isinstance(k, types.StringType))
+ self.assert_(isinstance(k, str))
self.assertEqual(self.tree[k], v)
def test_suite():