[Zope-Checkins] CVS: Zope/lib/python/Products/ZCatalog/tests - testCatalog.py:1.13
Casey Duncan
casey@zope.com
Tue, 11 Jun 2002 16:20:13 -0400
Update of /cvs-repository/Zope/lib/python/Products/ZCatalog/tests
In directory cvs.zope.org:/tmp/cvs-serv28876/lib/python/Products/ZCatalog/tests
Modified Files:
testCatalog.py
Log Message:
Removed vocabulary management from catalog/ZCatalog. They now have no awareness of vocabularies.
The only API change was the removal of the getVocabulary method from ZCatalog.
Old-style TextIndexes can now acquire a Vocabulary from anywhere.
No Indexes, metadata or vocabulary objects are created automatically by ZCatalog.
=== Zope/lib/python/Products/ZCatalog/tests/testCatalog.py 1.12 => 1.13 ===
assert self._catalog.indexes.has_key('id') != 1, 'del index failed'
-class TestZCatalogObject(unittest.TestCase):
- def setUp(self):
- class dummy(ExtensionClass.Base):
- pass
- self.dummy = dummy()
- newSecurityManager( None, DummyUser( 'phred' ) )
-
- def tearDown(self):
- noSecurityManager()
- self.dummy = None
-
- def testInstantiateWithoutVocab(self):
- v = Vocabulary.Vocabulary('Vocabulary', 'Vocabulary', globbing=1)
- zc = ZCatalog.ZCatalog('acatalog')
- assert hasattr(zc, 'Vocabulary')
- assert zc.getVocabulary().__class__ == v.__class__
-
- def testInstantiateWithGlobbingVocab(self):
- dummy = self.dummy
- v = Vocabulary.Vocabulary('Vocabulary', 'Vocabulary', globbing=1)
- dummy.v = v
- zc = ZCatalog.ZCatalog('acatalog', vocab_id='v', container=dummy)
- zc = zc.__of__(dummy)
- assert zc.getVocabulary() == v
-
- def testInstantiateWithNormalVocab(self):
- dummy = self.dummy
- v = Vocabulary.Vocabulary('Vocabulary', 'Vocabulary', globbing=0)
- dummy.v = v
- zc = ZCatalog.ZCatalog('acatalog', vocab_id='v', container=dummy)
- zc = zc.__of__(dummy)
- assert zc.getVocabulary() == v
+# Removed unittests dealing with catalog instantiation and vocabularies
+# since catalog no longer creates/manages vocabularies automatically (Casey)
class TestCatalogObject(unittest.TestCase):
def setUp(self):
@@ -376,7 +346,6 @@
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite( TestAddDelColumn ) )
suite.addTest( unittest.makeSuite( TestAddDelIndexes ) )
- suite.addTest( unittest.makeSuite( TestZCatalogObject ) )
suite.addTest( unittest.makeSuite( TestCatalogObject ) )
suite.addTest( unittest.makeSuite( testRS ) )
return suite