Mercurial > p > roundup > code
comparison test/db_test_base.py @ 3906:666b70676ec6
destroy blobfiles if they exist
Fixes [SF#1654132]
| author | Justus Pendleton <jpend@users.sourceforge.net> |
|---|---|
| date | Sun, 16 Sep 2007 06:51:48 +0000 |
| parents | 46ef2a6fd79d |
| children | 65b5fffac46b |
comparison
equal
deleted
inserted
replaced
| 3905:6733a7cce7f4 | 3906:666b70676ec6 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 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" | 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, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: db_test_base.py,v 1.89 2007-09-03 17:14:09 jpend Exp $ | 18 # $Id: db_test_base.py,v 1.90 2007-09-16 06:51:48 jpend Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil, errno, imp, sys, time, pprint, sets, base64 | 20 import unittest, os, shutil, errno, imp, sys, time, pprint, sets, base64, os.path |
| 21 | 21 |
| 22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ | 22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ |
| 23 Interval, DatabaseError, Boolean, Number, Node | 23 Interval, DatabaseError, Boolean, Number, Node |
| 24 from roundup.mailer import Mailer | 24 from roundup.mailer import Mailer |
| 25 from roundup import date, password, init, instance, configuration, support | 25 from roundup import date, password, init, instance, configuration, support |
| 545 # get the prop so the info's forced into the cache (if there is one) | 545 # get the prop so the info's forced into the cache (if there is one) |
| 546 self.db.user.get('1', 'username') | 546 self.db.user.get('1', 'username') |
| 547 self.db.rollback() | 547 self.db.rollback() |
| 548 name2 = self.db.user.get('1', 'username') | 548 name2 = self.db.user.get('1', 'username') |
| 549 self.assertEqual(name1, name2) | 549 self.assertEqual(name1, name2) |
| 550 | |
| 551 def testDestroyBlob(self): | |
| 552 # destroy an uncommitted blob | |
| 553 f1 = self.db.file.create(content='hello', type="text/plain") | |
| 554 self.db.commit() | |
| 555 fn = self.db.filename('file', f1) | |
| 556 self.db.file.destroy(f1) | |
| 557 self.db.commit() | |
| 558 self.assertEqual(os.path.exists(fn), False) | |
| 550 | 559 |
| 551 def testDestroyNoJournalling(self): | 560 def testDestroyNoJournalling(self): |
| 552 self.innerTestDestroy(klass=self.db.session) | 561 self.innerTestDestroy(klass=self.db.session) |
| 553 | 562 |
| 554 def testDestroyJournalling(self): | 563 def testDestroyJournalling(self): |
