[Zodb-checkins] CVS: ZODB3/BTrees/tests - testBTreesUnicode.py:1.7.92.1

Tim Peters tim.one at comcast.net
Mon Jul 7 15:35:52 EDT 2003


Update of /cvs-repository/ZODB3/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv29246/BTrees/tests

Modified Files:
      Tag: zodb33-devel-branch
	testBTreesUnicode.py 
Log Message:
Replace 2.1-ish type-checking to make this closer to the ZODB4 version.


=== ZODB3/BTrees/tests/testBTreesUnicode.py 1.7 => 1.7.92.1 ===
--- ZODB3/BTrees/tests/testBTreesUnicode.py:1.7	Sat Jun  8 15:40:13 2002
+++ ZODB3/BTrees/tests/testBTreesUnicode.py	Mon Jul  7 14:35:45 2003
@@ -14,7 +14,7 @@
 
 __version__ = '$Id$'
 
-import unittest,types
+import unittest
 from BTrees.OOBTree import OOBTree
 
 # When an OOBtree contains unicode strings as keys,
@@ -43,14 +43,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 +65,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():




More information about the Zodb-checkins mailing list