[Zope-Checkins] CVS: Zope/lib/python/Products/ZCTextIndex/tests - testLexicon.py:1.5.16.4

Casey Duncan casey@zope.com
Thu, 5 Jun 2003 12:04:27 -0400


Update of /cvs-repository/Zope/lib/python/Products/ZCTextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv22205/tests

Modified Files:
      Tag: casey-zctextindex-fewer-conflicts-branch
	testLexicon.py 
Log Message:
Make sure lexicon.length attr is overridden in older lexicon instances
Add test for this


=== Zope/lib/python/Products/ZCTextIndex/tests/testLexicon.py 1.5.16.3 => 1.5.16.4 ===
--- Zope/lib/python/Products/ZCTextIndex/tests/testLexicon.py:1.5.16.3	Thu Jun  5 11:38:05 2003
+++ Zope/lib/python/Products/ZCTextIndex/tests/testLexicon.py	Thu Jun  5 12:04:26 2003
@@ -137,6 +137,13 @@
         self.assertEqual(words, expected)
         locale.setlocale(locale.LC_ALL, loc) # restore saved locale
         
+    def testUpgradeLength(self):
+        from BTrees.Length import Length
+        lexicon = Lexicon(Splitter())
+        del lexicon.length # Older instances don't override length
+        lexicon.sourceToWordIds('how now brown cow')
+        self.assert_(lexicon.length.__class__ is Length)        
+        
 class TestLexiconConflict(TestCase):
     
     storage = None