[Zodb-checkins] CVS: Zope/lib/python/BTrees/tests - testBTreesUnicode.py:1.3
Jeremy Hylton
jeremy@zope.com
Thu, 18 Oct 2001 12:25:18 -0400
Update of /cvs-repository/Zope/lib/python/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv28582
Modified Files:
testBTreesUnicode.py
Log Message:
Remove imports of os and sys (unneeded after framework.py removed).
Replace explicit equality tests in assert statements, which aren't
executed when running python -O, when self.assertEquals(), which also
has the side effect of producing better error messages when the test
fails.
=== Zope/lib/python/BTrees/tests/testBTreesUnicode.py 1.2 => 1.3 ===
+import unittest
from BTrees.OOBTree import OOBTree
-
class TestBTreesUnicode(unittest.TestCase):
""" test unicode"""
@@ -19,24 +18,23 @@
(unicode('dreit\xe4gigen','latin1'), 284708391)]
self.tree = OOBTree()
- for k,v in self.data: self.tree[k]=v
+ 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
+ for k, v in self.data:
+ self.assertEqual(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]
-
+ self.assertEqual(self.data[-1][0], self.s)
+ self.assertEqual(self.tree[self.data[-1][0]], self.data[-1][1])
+ self.assertEqual(self.tree[self.s], self.data[-1][1])
def test_suite():
- return unittest.makeSuite(TestBTreesUnicode,'test')
-
+ return unittest.makeSuite(TestBTreesUnicode, 'test')