[Zope-CVS] CVS: Products/ZCTextIndex/tests - testPipelineFactory.py:1.2

Casey Duncan casey@zope.com
Wed, 22 May 2002 15:53:10 -0400

Update of /cvs-repository/Products/ZCTextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv4487/tests

Modified Files:
Log Message:
Enhanced pipeline element factory so that you can group elements that must be
selected in a mutally exclusive manner (such as splitters).

Existing pipeline elements have been grouped appropriately.

Added a stop word remover that does not remove single char words.

Modified ZMI lexicon add form to use pipeline element groups to render form.
Groups with multiple elements are rendered as selects, singletons are rendered
as checkboxes.

=== Products/ZCTextIndex/tests/testPipelineFactory.py 1.1 => 1.2 ===
         self.dooey = NullPipelineElement()
         self.louie = NullPipelineElement()
+        self.daffy = NullPipelineElement()
     def testPipeline(self):
         pf = PipelineElementFactory()
-        pf.registerFactory('huey', self.huey)
-        pf.registerFactory('dooey', self.dooey)
-        pf.registerFactory('louie', self.louie)
-        self.assertRaises(ValueError, pf.registerFactory, 'huey', self.huey)
-        self.assertEqual(pf.getFactoryNames(), ['dooey', 'huey', 'louie'])
+        pf.registerFactory('donald', 'huey', self.huey)
+        pf.registerFactory('donald', 'dooey',  self.dooey)
+        pf.registerFactory('donald', 'louie', self.louie)
+        pf.registerFactory('looney', 'daffy', self.daffy)
+        self.assertRaises(ValueError, pf.registerFactory,'donald',  'huey', 
+                          self.huey)
+        self.assertEqual(pf.getFactoryGroups(), ['donald', 'looney'])
+        self.assertEqual(pf.getFactoryNames('donald'), 
+                         ['dooey', 'huey', 'louie'])
 def test_suite():
     return makeSuite(PipelineFactoryTest)