Commit 615217a1 authored by Hanno Schlichting's avatar Hanno Schlichting

More tests for add/del index/column

parent e6910ec7
...@@ -143,12 +143,29 @@ class TestZCatalog(unittest.TestCase): ...@@ -143,12 +143,29 @@ class TestZCatalog(unittest.TestCase):
verifyClass(IZCatalog, ZCatalog) verifyClass(IZCatalog, ZCatalog)
def testAddIndex(self):
self._catalog.addIndex('id', 'FieldIndex')
self.assert_('id' in self._catalog.indexes())
def testDelIndex(self):
self.assert_('title' in self._catalog.indexes())
self._catalog.delIndex('title')
self.assert_('title' not in self._catalog.indexes())
def testClearIndex(self): def testClearIndex(self):
idx = self._catalog._catalog.getIndex('title') idx = self._catalog._catalog.getIndex('title')
self.assertEquals(len(idx), self.upper) self.assertEquals(len(idx), self.upper)
self._catalog.clearIndex('title') self._catalog.clearIndex('title')
self.assertEquals(len(idx), 0) self.assertEquals(len(idx), 0)
def testAddColumn(self):
self._catalog.addColumn('num', default_value=0)
self.assert_('num' in self._catalog.schema())
def testDelColumn(self):
self._catalog.delColumn('title')
self.assert_('title' not in self._catalog.schema())
def testGetMetadataForUID(self): def testGetMetadataForUID(self):
testNum = str(self.upper - 3) # as good as any.. testNum = str(self.upper - 3) # as good as any..
data = self._catalog.getMetadataForUID(testNum) data = self._catalog.getMetadataForUID(testNum)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment