Code

added tests for number type too
[roundup.git] / test / test_db.py
1 #
2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
3 # This module is free software, and you may redistribute it and/or modify
4 # under the same terms as Python, so long as this copyright message and
5 # disclaimer are retained in their original form.
6 #
7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
10 # POSSIBILITY OF SUCH DAMAGE.
11 #
12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17
18 # $Id: test_db.py,v 1.33 2002-07-18 11:50:58 richard Exp $ 
20 import unittest, os, shutil, time
22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \
23     Interval, DatabaseError, Boolean, Number
24 from roundup import date, password
25 from roundup.indexer import Indexer
27 def setupSchema(db, create, module):
28     status = module.Class(db, "status", name=String())
29     status.setkey("name")
30     user = module.Class(db, "user", username=String(), password=Password(),
31         assignable=Boolean(), age=Number())
32     file = module.FileClass(db, "file", name=String(), type=String(),
33         comment=String(indexme="yes"))
34     issue = module.IssueClass(db, "issue", title=String(indexme="yes"),
35         status=Link("status"), nosy=Multilink("user"), deadline=Date(),
36         foo=Interval(), files=Multilink("file"))
37     db.post_init()
38     if create:
39         status.create(name="unread")
40         status.create(name="in-progress")
41         status.create(name="testing")
42         status.create(name="resolved")
43     db.commit()
45 class MyTestCase(unittest.TestCase):
46     def tearDown(self):
47         if os.path.exists('_test_dir'):
48             shutil.rmtree('_test_dir')
50 class config:
51     DATABASE='_test_dir'
52     MAILHOST = 'localhost'
53     MAIL_DOMAIN = 'fill.me.in.'
54     INSTANCE_NAME = 'Roundup issue tracker'
55     ISSUE_TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN
56     ISSUE_TRACKER_WEB = 'http://some.useful.url/'
57     ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN
58     FILTER_POSITION = 'bottom'      # one of 'top', 'bottom', 'top and bottom'
59     ANONYMOUS_ACCESS = 'deny'       # either 'deny' or 'allow'
60     ANONYMOUS_REGISTER = 'deny'     # either 'deny' or 'allow'
61     MESSAGES_TO_AUTHOR = 'no'       # either 'yes' or 'no'
62     EMAIL_SIGNATURE_POSITION = 'bottom'
64 class anydbmDBTestCase(MyTestCase):
65     def setUp(self):
66         from roundup.backends import anydbm
67         # remove previous test, ignore errors
68         if os.path.exists(config.DATABASE):
69             shutil.rmtree(config.DATABASE)
70         os.makedirs(config.DATABASE + '/files')
71         self.db = anydbm.Database(config, 'test')
72         setupSchema(self.db, 1, anydbm)
73         self.db2 = anydbm.Database(config, 'test')
74         setupSchema(self.db2, 0, anydbm)
76     def xtestStringChange(self):
77         self.db.issue.create(title="spam", status='1')
78         self.assertEqual(self.db.issue.get('1', 'title'), 'spam')
79         self.db.issue.set('1', title='eggs')
80         self.assertEqual(self.db.issue.get('1', 'title'), 'eggs')
81         self.db.commit()
82         self.assertEqual(self.db.issue.get('1', 'title'), 'eggs')
83         self.db.issue.create(title="spam", status='1')
84         self.db.commit()
85         self.assertEqual(self.db.issue.get('2', 'title'), 'spam')
86         self.db.issue.set('2', title='ham')
87         self.assertEqual(self.db.issue.get('2', 'title'), 'ham')
88         self.db.commit()
89         self.assertEqual(self.db.issue.get('2', 'title'), 'ham')
91     def xtestLinkChange(self):
92         self.db.issue.create(title="spam", status='1')
93         self.assertEqual(self.db.issue.get('1', "status"), '1')
94         self.db.issue.set('1', status='2')
95         self.assertEqual(self.db.issue.get('1', "status"), '2')
97     def xtestDateChange(self):
98         self.db.issue.create(title="spam", status='1')
99         a = self.db.issue.get('1', "deadline")
100         self.db.issue.set('1', deadline=date.Date())
101         b = self.db.issue.get('1', "deadline")
102         self.db.commit()
103         self.assertNotEqual(a, b)
104         self.assertNotEqual(b, date.Date('1970-1-1 00:00:00'))
105         self.db.issue.set('1', deadline=date.Date())
107     def xtestIntervalChange(self):
108         self.db.issue.create(title="spam", status='1')
109         a = self.db.issue.get('1', "foo")
110         self.db.issue.set('1', foo=date.Interval('-1d'))
111         self.assertNotEqual(self.db.issue.get('1', "foo"), a)
113     def testBooleanChange(self):
114         self.db.user.create(username='foo', assignable=1)
115         a = self.db.user.get('1', 'assignable')
116         self.db.user.set('1', assignable='false')
117         self.assertNotEqual(self.db.user.get('1', 'assignable'), a)
118         self.db.user.set('1', assignable='FaLse')
119         self.db.user.set('1', assignable='nO')
120         self.db.user.set('1', assignable=0)
121         self.db.user.set('1', assignable='tRuE')
122         self.db.user.set('1', assignable='yEs')
123         self.db.user.set('1', assignable=1)
125     def testNumberChange(self):
126         self.db.user.create(username='foo', age='1')
127         a = self.db.user.get('1', 'age')
128         self.db.user.set('1', age='3')
129         self.assertNotEqual(self.db.user.get('1', 'age'), a)
130         self.db.user.set('1', age='1.0')
132     def xtestNewProperty(self):
133         ' make sure a new property is added ok '
134         self.db.issue.create(title="spam", status='1')
135         self.db.issue.addprop(fixer=Link("user"))
136         props = self.db.issue.getprops()
137         keys = props.keys()
138         keys.sort()
139         self.assertEqual(keys, ['activity', 'creation', 'creator', 'deadline',
140             'files', 'fixer', 'foo', 'id', 'messages', 'nosy', 'status',
141             'superseder', 'title'])
142         self.assertEqual(self.db.issue.get('1', "fixer"), None)
144     def xtestRetire(self):
145         self.db.issue.create(title="spam", status='1')
146         b = self.db.status.get('1', 'name')
147         a = self.db.status.list()
148         self.db.status.retire('1')
149         # make sure the list is different 
150         self.assertNotEqual(a, self.db.status.list())
151         # can still access the node if necessary
152         self.assertEqual(self.db.status.get('1', 'name'), b)
153         self.db.commit()
154         self.assertEqual(self.db.status.get('1', 'name'), b)
155         self.assertNotEqual(a, self.db.status.list())
157     def xtestSerialisation(self):
158         self.db.issue.create(title="spam", status='1',
159             deadline=date.Date(), foo=date.Interval('-1d'))
160         self.db.commit()
161         assert isinstance(self.db.issue.get('1', 'deadline'), date.Date)
162         assert isinstance(self.db.issue.get('1', 'foo'), date.Interval)
163         self.db.user.create(username="fozzy",
164             password=password.Password('t. bear'))
165         self.db.commit()
166         assert isinstance(self.db.user.get('1', 'password'), password.Password)
168     def xtestTransactions(self):
169         # remember the number of items we started
170         num_issues = len(self.db.issue.list())
171         num_files = self.db.numfiles()
172         self.db.issue.create(title="don't commit me!", status='1')
173         self.assertNotEqual(num_issues, len(self.db.issue.list()))
174         self.db.rollback()
175         self.assertEqual(num_issues, len(self.db.issue.list()))
176         self.db.issue.create(title="please commit me!", status='1')
177         self.assertNotEqual(num_issues, len(self.db.issue.list()))
178         self.db.commit()
179         self.assertNotEqual(num_issues, len(self.db.issue.list()))
180         self.db.rollback()
181         self.assertNotEqual(num_issues, len(self.db.issue.list()))
182         self.db.file.create(name="test", type="text/plain", content="hi")
183         self.db.rollback()
184         self.assertEqual(num_files, self.db.numfiles())
185         for i in range(10):
186             self.db.file.create(name="test", type="text/plain", 
187                     content="hi %d"%(i))
188             self.db.commit()
189         num_files2 = self.db.numfiles()
190         self.assertNotEqual(num_files, num_files2)
191         self.db.file.create(name="test", type="text/plain", content="hi")
192         self.db.rollback()
193         self.assertNotEqual(num_files, self.db.numfiles())
194         self.assertEqual(num_files2, self.db.numfiles())
196     def testExceptions(self):
197         # this tests the exceptions that should be raised
198         ar = self.assertRaises
200         #
201         # class create
202         #
203         # string property
204         ar(TypeError, self.db.status.create, name=1)
205         # invalid property name
206         ar(KeyError, self.db.status.create, foo='foo')
207         # key name clash
208         ar(ValueError, self.db.status.create, name='unread')
209         # invalid link index
210         ar(IndexError, self.db.issue.create, title='foo', status='bar')
211         # invalid link value
212         ar(ValueError, self.db.issue.create, title='foo', status=1)
213         # invalid multilink type
214         ar(TypeError, self.db.issue.create, title='foo', status='1',
215             nosy='hello')
216         # invalid multilink index type
217         ar(ValueError, self.db.issue.create, title='foo', status='1',
218             nosy=[1])
219         # invalid multilink index
220         ar(IndexError, self.db.issue.create, title='foo', status='1',
221             nosy=['10'])
223         #
224         # key property
225         # 
226         # key must be a String
227         ar(TypeError, self.db.user.setkey, 'password')
228         # key must exist
229         ar(KeyError, self.db.user.setkey, 'fubar')
231         #
232         # class get
233         #
234         # invalid node id
235         ar(IndexError, self.db.issue.get, '1', 'title')
236         # invalid property name
237         ar(KeyError, self.db.status.get, '2', 'foo')
239         #
240         # class set
241         #
242         # invalid node id
243         ar(IndexError, self.db.issue.set, '1', title='foo')
244         # invalid property name
245         ar(KeyError, self.db.status.set, '1', foo='foo')
246         # string property
247         ar(TypeError, self.db.status.set, '1', name=1)
248         # key name clash
249         ar(ValueError, self.db.status.set, '2', name='unread')
250         # set up a valid issue for me to work on
251         self.db.issue.create(title="spam", status='1')
252         # invalid link index
253         ar(IndexError, self.db.issue.set, '6', title='foo', status='bar')
254         # invalid link value
255         ar(ValueError, self.db.issue.set, '6', title='foo', status=1)
256         # invalid multilink type
257         ar(TypeError, self.db.issue.set, '6', title='foo', status='1',
258             nosy='hello')
259         # invalid multilink index type
260         ar(ValueError, self.db.issue.set, '6', title='foo', status='1',
261             nosy=[1])
262         # invalid multilink index
263         ar(IndexError, self.db.issue.set, '6', title='foo', status='1',
264             nosy=['10'])
265         # invalid number value
266         ar(TypeError, self.db.user.create, username='foo', age='a')
267         # invalid boolean value
268         ar(TypeError, self.db.user.create, username='foo', assignable='fubar')
269         self.db.user.create(username='foo')
270         # invalid number value
271         ar(TypeError, self.db.user.set, '3', username='foo', age='a')
272         # invalid boolean value
273         ar(TypeError, self.db.user.set, '3', username='foo', assignable='fubar')
275     def xtestJournals(self):
276         self.db.issue.addprop(fixer=Link("user", do_journal='yes'))
277         self.db.user.create(username="mary")
278         self.db.user.create(username="pete")
279         self.db.issue.create(title="spam", status='1')
280         self.db.commit()
282         # journal entry for issue create
283         journal = self.db.getjournal('issue', '1')
284         self.assertEqual(1, len(journal))
285         (nodeid, date_stamp, journaltag, action, params) = journal[0]
286         self.assertEqual(nodeid, '1')
287         self.assertEqual(journaltag, 'test')
288         self.assertEqual(action, 'create')
289         keys = params.keys()
290         keys.sort()
291         self.assertEqual(keys, ['deadline', 'files', 'fixer', 'foo',
292             'messages', 'nosy', 'status', 'superseder', 'title'])
293         self.assertEqual(None,params['deadline'])
294         self.assertEqual(None,params['fixer'])
295         self.assertEqual(None,params['foo'])
296         self.assertEqual([],params['nosy'])
297         self.assertEqual('1',params['status'])
298         self.assertEqual('spam',params['title'])
300         # journal entry for link
301         journal = self.db.getjournal('user', '1')
302         self.assertEqual(1, len(journal))
303         self.db.issue.set('1', fixer='1')
304         self.db.commit()
305         journal = self.db.getjournal('user', '1')
306         self.assertEqual(2, len(journal))
307         (nodeid, date_stamp, journaltag, action, params) = journal[1]
308         self.assertEqual('1', nodeid)
309         self.assertEqual('test', journaltag)
310         self.assertEqual('link', action)
311         self.assertEqual(('issue', '1', 'fixer'), params)
313         # journal entry for unlink
314         self.db.issue.set('1', fixer='2')
315         self.db.commit()
316         journal = self.db.getjournal('user', '1')
317         self.assertEqual(3, len(journal))
318         (nodeid, date_stamp, journaltag, action, params) = journal[2]
319         self.assertEqual('1', nodeid)
320         self.assertEqual('test', journaltag)
321         self.assertEqual('unlink', action)
322         self.assertEqual(('issue', '1', 'fixer'), params)
324         # test disabling journalling
325         # ... get the last entry
326         time.sleep(1)
327         entry = self.db.getjournal('issue', '1')[-1]
328         (x, date_stamp, x, x, x) = entry
329         self.db.issue.disableJournalling()
330         self.db.issue.set('1', title='hello world')
331         self.db.commit()
332         entry = self.db.getjournal('issue', '1')[-1]
333         (x, date_stamp2, x, x, x) = entry
334         # see if the change was journalled when it shouldn't have been
335         self.assertEqual(date_stamp, date_stamp2)
336         self.db.issue.enableJournalling()
337         self.db.issue.set('1', title='hello world 2')
338         self.db.commit()
339         entry = self.db.getjournal('issue', '1')[-1]
340         (x, date_stamp2, x, x, x) = entry
341         # see if the change was journalled
342         self.assertNotEqual(date_stamp, date_stamp2)
344     def xtestPack(self):
345         self.db.issue.create(title="spam", status='1')
346         self.db.commit()
347         self.db.issue.set('1', status='2')
348         self.db.commit()
349         self.db.issue.set('1', status='3')
350         self.db.commit()
351         pack_before = date.Date(". + 1d")
352         self.db.pack(pack_before)
353         journal = self.db.getjournal('issue', '1')
354         self.assertEqual(2, len(journal))
356     def xtestIDGeneration(self):
357         id1 = self.db.issue.create(title="spam", status='1')
358         id2 = self.db2.issue.create(title="eggs", status='2')
359         self.assertNotEqual(id1, id2)
361     def xtestSearching(self):
362         self.db.file.create(content='hello', type="text/plain")
363         self.db.file.create(content='world', type="text/frozz",
364             comment='blah blah')
365         self.db.issue.create(files=['1', '2'], title="flebble plop")
366         self.db.issue.create(title="flebble frooz")
367         self.db.commit()
368         self.assertEquals(self.db.indexer.search(['hello'], self.db.issue),
369             {'1': {'files': ['1']}})
370         self.assertEquals(self.db.indexer.search(['world'], self.db.issue), {})
371         self.assertEquals(self.db.indexer.search(['frooz'], self.db.issue),
372             {'2': {}})
373         self.assertEquals(self.db.indexer.search(['flebble'], self.db.issue),
374             {'2': {}, '1': {}})
376     def xtestReindexing(self):
377         self.db.issue.create(title="frooz")
378         self.db.commit()
379         self.assertEquals(self.db.indexer.search(['frooz'], self.db.issue),
380             {'1': {}})
381         self.db.issue.set('1', title="dooble")
382         self.db.commit()
383         self.assertEquals(self.db.indexer.search(['dooble'], self.db.issue),
384             {'1': {}})
385         self.assertEquals(self.db.indexer.search(['frooz'], self.db.issue), {})
387     def xtestForcedReindexing(self):
388         self.db.issue.create(title="flebble frooz")
389         self.db.commit()
390         self.assertEquals(self.db.indexer.search(['flebble'], self.db.issue),
391             {'1': {}})
392         self.db.indexer.quiet = 1
393         self.db.indexer.force_reindex()
394         self.db.post_init()
395         self.db.indexer.quiet = 9
396         self.assertEquals(self.db.indexer.search(['flebble'], self.db.issue),
397             {'1': {}})
399 class anydbmReadOnlyDBTestCase(MyTestCase):
400     def setUp(self):
401         from roundup.backends import anydbm
402         # remove previous test, ignore errors
403         if os.path.exists(config.DATABASE):
404             shutil.rmtree(config.DATABASE)
405         os.makedirs(config.DATABASE + '/files')
406         db = anydbm.Database(config, 'test')
407         setupSchema(db, 1, anydbm)
408         self.db = anydbm.Database(config)
409         setupSchema(self.db, 0, anydbm)
410         self.db2 = anydbm.Database(config, 'test')
411         setupSchema(self.db2, 0, anydbm)
413     def xtestExceptions(self):
414         ' make sure exceptions are raised on writes to a read-only db '
415         # this tests the exceptions that should be raised
416         ar = self.assertRaises
418         # this tests the exceptions that should be raised
419         ar(DatabaseError, self.db.status.create, name="foo")
420         ar(DatabaseError, self.db.status.set, '1', name="foo")
421         ar(DatabaseError, self.db.status.retire, '1')
424 class bsddbDBTestCase(anydbmDBTestCase):
425     def setUp(self):
426         from roundup.backends import bsddb
427         # remove previous test, ignore errors
428         if os.path.exists(config.DATABASE):
429             shutil.rmtree(config.DATABASE)
430         os.makedirs(config.DATABASE + '/files')
431         self.db = bsddb.Database(config, 'test')
432         setupSchema(self.db, 1, bsddb)
433         self.db2 = bsddb.Database(config, 'test')
434         setupSchema(self.db2, 0, bsddb)
436 class bsddbReadOnlyDBTestCase(anydbmReadOnlyDBTestCase):
437     def setUp(self):
438         from roundup.backends import bsddb
439         # remove previous test, ignore errors
440         if os.path.exists(config.DATABASE):
441             shutil.rmtree(config.DATABASE)
442         os.makedirs(config.DATABASE + '/files')
443         db = bsddb.Database(config, 'test')
444         setupSchema(db, 1, bsddb)
445         self.db = bsddb.Database(config)
446         setupSchema(self.db, 0, bsddb)
447         self.db2 = bsddb.Database(config, 'test')
448         setupSchema(self.db2, 0, bsddb)
451 class bsddb3DBTestCase(anydbmDBTestCase):
452     def setUp(self):
453         from roundup.backends import bsddb3
454         # remove previous test, ignore errors
455         if os.path.exists(config.DATABASE):
456             shutil.rmtree(config.DATABASE)
457         os.makedirs(config.DATABASE + '/files')
458         self.db = bsddb3.Database(config, 'test')
459         setupSchema(self.db, 1, bsddb3)
460         self.db2 = bsddb3.Database(config, 'test')
461         setupSchema(self.db2, 0, bsddb3)
463 class bsddb3ReadOnlyDBTestCase(anydbmReadOnlyDBTestCase):
464     def setUp(self):
465         from roundup.backends import bsddb3
466         # remove previous test, ignore errors
467         if os.path.exists(config.DATABASE):
468             shutil.rmtree(config.DATABASE)
469         os.makedirs(config.DATABASE + '/files')
470         db = bsddb3.Database(config, 'test')
471         setupSchema(db, 1, bsddb3)
472         self.db = bsddb3.Database(config)
473         setupSchema(self.db, 0, bsddb3)
474         self.db2 = bsddb3.Database(config, 'test')
475         setupSchema(self.db2, 0, bsddb3)
478 class metakitDBTestCase(anydbmDBTestCase):
479     def setUp(self):
480         from roundup.backends import metakit
481         import weakref
482         metakit._instances = weakref.WeakValueDictionary()
483         # remove previous test, ignore errors
484         if os.path.exists(config.DATABASE):
485             shutil.rmtree(config.DATABASE)
486         os.makedirs(config.DATABASE + '/files')
487         self.db = metakit.Database(config, 'test')
488         setupSchema(self.db, 1, metakit)
489         self.db2 = metakit.Database(config, 'test')
490         setupSchema(self.db2, 0, metakit)
492     def xtestTransactions(self):
493         # remember the number of items we started
494         num_issues = len(self.db.issue.list())
495         self.db.issue.create(title="don't commit me!", status='1')
496         self.assertNotEqual(num_issues, len(self.db.issue.list()))
497         self.db.rollback()
498         self.assertEqual(num_issues, len(self.db.issue.list()))
499         self.db.issue.create(title="please commit me!", status='1')
500         self.assertNotEqual(num_issues, len(self.db.issue.list()))
501         self.db.commit()
502         self.assertNotEqual(num_issues, len(self.db.issue.list()))
503         self.db.rollback()
504         self.assertNotEqual(num_issues, len(self.db.issue.list()))
505         self.db.file.create(name="test", type="text/plain", content="hi")
506         self.db.rollback()
507         for i in range(10):
508             self.db.file.create(name="test", type="text/plain", 
509                     content="hi %d"%(i))
510             self.db.commit()
511         # TODO: would be good to be able to ensure the file is not on disk after
512         # a rollback...
513         self.assertNotEqual(num_files, num_files2)
514         self.db.file.create(name="test", type="text/plain", content="hi")
515         self.db.rollback()
517 class metakitReadOnlyDBTestCase(anydbmReadOnlyDBTestCase):
518     def setUp(self):
519         from roundup.backends import metakit
520         import weakref
521         metakit._instances = weakref.WeakValueDictionary()
522         # remove previous test, ignore errors
523         if os.path.exists(config.DATABASE):
524             shutil.rmtree(config.DATABASE)
525         os.makedirs(config.DATABASE + '/files')
526         db = metakit.Database(config, 'test')
527         setupSchema(db, 1, metakit)
528         self.db = metakit.Database(config)
529         setupSchema(self.db, 0, metakit)
530         self.db2 = metakit.Database(config, 'test')
531         setupSchema(self.db2, 0, metakit)
533 def suite():
534     l = [
535          unittest.makeSuite(anydbmDBTestCase, 'test'),
536          unittest.makeSuite(anydbmReadOnlyDBTestCase, 'test')
537     ]
538     return unittest.TestSuite(l)
540     try:
541         import bsddb
542         l.append(unittest.makeSuite(bsddbDBTestCase, 'test'))
543         l.append(unittest.makeSuite(bsddbReadOnlyDBTestCase, 'test'))
544     except:
545         print 'bsddb module not found, skipping bsddb DBTestCase'
547     try:
548         import bsddb3
549         l.append(unittest.makeSuite(bsddb3DBTestCase, 'test'))
550         l.append(unittest.makeSuite(bsddb3ReadOnlyDBTestCase, 'test'))
551     except:
552         print 'bsddb3 module not found, skipping bsddb3 DBTestCase'
554     try:
555         import metakit
556         l.append(unittest.makeSuite(metakitDBTestCase, 'test'))
557         l.append(unittest.makeSuite(metakitReadOnlyDBTestCase, 'test'))
558     except:
559         print 'metakit module not found, skipping metakit DBTestCase'
561     return unittest.TestSuite(l)
564 # $Log: not supported by cvs2svn $
565 # Revision 1.32  2002/07/18 11:41:10  richard
566 # added tests for boolean type, and fixes to anydbm backend
568 # Revision 1.31  2002/07/14 23:17:45  richard
569 # minor change to make testing easier
571 # Revision 1.30  2002/07/14 06:06:34  richard
572 # Did some old TODOs
574 # Revision 1.29  2002/07/14 04:03:15  richard
575 # Implemented a switch to disable journalling for a Class. CGI session
576 # database now uses it.
578 # Revision 1.28  2002/07/14 02:16:29  richard
579 # Fixes for the metakit backend (removed the cut-n-paste IssueClass, removed
580 # a special case for it in testing)
582 # Revision 1.27  2002/07/14 02:05:54  richard
583 # . all storage-specific code (ie. backend) is now implemented by the backends
585 # Revision 1.26  2002/07/11 01:11:03  richard
586 # Added metakit backend to the db tests and fixed the more easily fixable test
587 # failures.
589 # Revision 1.25  2002/07/09 04:19:09  richard
590 # Added reindex command to roundup-admin.
591 # Fixed reindex on first access.
592 # Also fixed reindexing of entries that change.
594 # Revision 1.24  2002/07/09 03:02:53  richard
595 # More indexer work:
596 # - all String properties may now be indexed too. Currently there's a bit of
597 #   "issue" specific code in the actual searching which needs to be
598 #   addressed. In a nutshell:
599 #   + pass 'indexme="yes"' as a String() property initialisation arg, eg:
600 #         file = FileClass(db, "file", name=String(), type=String(),
601 #             comment=String(indexme="yes"))
602 #   + the comment will then be indexed and be searchable, with the results
603 #     related back to the issue that the file is linked to
604 # - as a result of this work, the FileClass has a default MIME type that may
605 #   be overridden in a subclass, or by the use of a "type" property as is
606 #   done in the default templates.
607 # - the regeneration of the indexes (if necessary) is done once the schema is
608 #   set up in the dbinit.
610 # Revision 1.23  2002/06/20 23:51:48  richard
611 # Cleaned up the hyperdb tests
613 # Revision 1.22  2002/05/21 05:52:11  richard
614 # Well whadya know, bsddb3 works again.
615 # The backend is implemented _exactly_ the same as bsddb - so there's no
616 # using its transaction or locking support. It'd be nice to use those some
617 # day I suppose.
619 # Revision 1.21  2002/04/15 23:25:15  richard
620 # . node ids are now generated from a lockable store - no more race conditions
622 # We're using the portalocker code by Jonathan Feinberg that was contributed
623 # to the ASPN Python cookbook. This gives us locking across Unix and Windows.
625 # Revision 1.20  2002/04/03 05:54:31  richard
626 # Fixed serialisation problem by moving the serialisation step out of the
627 # hyperdb.Class (get, set) into the hyperdb.Database.
629 # Also fixed htmltemplate after the showid changes I made yesterday.
631 # Unit tests for all of the above written.
633 # Revision 1.19  2002/02/25 14:34:31  grubert
634 #  . use blobfiles in back_anydbm which is used in back_bsddb.
635 #    change test_db as dirlist does not work for subdirectories.
636 #    ATTENTION: blobfiles now creates subdirectories for files.
638 # Revision 1.18  2002/01/22 07:21:13  richard
639 # . fixed back_bsddb so it passed the journal tests
641 # ... it didn't seem happy using the back_anydbm _open method, which is odd.
642 # Yet another occurrance of whichdb not being able to recognise older bsddb
643 # databases. Yadda yadda. Made the HYPERDBDEBUG stuff more sane in the
644 # process.
646 # Revision 1.17  2002/01/22 05:06:09  rochecompaan
647 # We need to keep the last 'set' entry in the journal to preserve
648 # information on 'activity' for nodes.
650 # Revision 1.16  2002/01/21 16:33:20  rochecompaan
651 # You can now use the roundup-admin tool to pack the database
653 # Revision 1.15  2002/01/19 13:16:04  rochecompaan
654 # Journal entries for link and multilink properties can now be switched on
655 # or off.
657 # Revision 1.14  2002/01/16 07:02:57  richard
658 #  . lots of date/interval related changes:
659 #    - more relaxed date format for input
661 # Revision 1.13  2002/01/14 02:20:15  richard
662 #  . changed all config accesses so they access either the instance or the
663 #    config attriubute on the db. This means that all config is obtained from
664 #    instance_config instead of the mish-mash of classes. This will make
665 #    switching to a ConfigParser setup easier too, I hope.
667 # At a minimum, this makes migration a _little_ easier (a lot easier in the
668 # 0.5.0 switch, I hope!)
670 # Revision 1.12  2001/12/17 03:52:48  richard
671 # Implemented file store rollback. As a bonus, the hyperdb is now capable of
672 # storing more than one file per node - if a property name is supplied,
673 # the file is called designator.property.
674 # I decided not to migrate the existing files stored over to the new naming
675 # scheme - the FileClass just doesn't specify the property name.
677 # Revision 1.11  2001/12/10 23:17:20  richard
678 # Added transaction tests to test_db
680 # Revision 1.10  2001/12/03 21:33:39  richard
681 # Fixes so the tests use commit and not close
683 # Revision 1.9  2001/12/02 05:06:16  richard
684 # . We now use weakrefs in the Classes to keep the database reference, so
685 #   the close() method on the database is no longer needed.
686 #   I bumped the minimum python requirement up to 2.1 accordingly.
687 # . #487480 ] roundup-server
688 # . #487476 ] INSTALL.txt
690 # I also cleaned up the change message / post-edit stuff in the cgi client.
691 # There's now a clearly marked "TODO: append the change note" where I believe
692 # the change note should be added there. The "changes" list will obviously
693 # have to be modified to be a dict of the changes, or somesuch.
695 # More testing needed.
697 # Revision 1.8  2001/10/09 07:25:59  richard
698 # Added the Password property type. See "pydoc roundup.password" for
699 # implementation details. Have updated some of the documentation too.
701 # Revision 1.7  2001/08/29 06:23:59  richard
702 # Disabled the bsddb3 module entirely in the unit testing. See CHANGES for
703 # details.
705 # Revision 1.6  2001/08/07 00:24:43  richard
706 # stupid typo
708 # Revision 1.5  2001/08/07 00:15:51  richard
709 # Added the copyright/license notice to (nearly) all files at request of
710 # Bizar Software.
712 # Revision 1.4  2001/07/30 03:45:56  richard
713 # Added more DB to test_db. Can skip tests where imports fail.
715 # Revision 1.3  2001/07/29 07:01:39  richard
716 # Added vim command to all source so that we don't get no steenkin' tabs :)
718 # Revision 1.2  2001/07/29 04:09:20  richard
719 # Added the fabricated property "id" to all hyperdb classes.
721 # Revision 1.1  2001/07/27 06:55:07  richard
722 # moving tests -> test
724 # Revision 1.7  2001/07/27 06:26:43  richard
725 # oops - wasn't deleting the test dir after the read-only tests
727 # Revision 1.6  2001/07/27 06:23:59  richard
728 # consistency
730 # Revision 1.5  2001/07/27 06:23:09  richard
731 # Added some new hyperdb tests to make sure we raise the right exceptions.
733 # Revision 1.4  2001/07/25 04:34:31  richard
734 # Added id and log to tests files...
737 # vim: set filetype=python ts=4 sw=4 et si