summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8b8b6f5)
raw | patch | inline | side by side (parent: 8b8b6f5)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 8 Feb 2010 08:30:37 +0000 (08:30 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 8 Feb 2010 08:30:37 +0000 (08:30 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4454 57a73879-2fb5-44c3-a270-3262357dd7e2
test/db_test_base.py | patch | blob | history | |
test/memorydb.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/test/db_test_base.py b/test/db_test_base.py
index 7fd26638fb74eee5182e8925b87b7cdcf8c25166..bb4272ab75a4c0ad6b3593d024d716b93d54bfc7 100644 (file)
--- a/test/db_test_base.py
+++ b/test/db_test_base.py
shutil.rmtree(config.DATABASE)
os.makedirs(config.DATABASE + '/files')
+ def open_database(self):
+ self.db = self.module.Database(config, 'admin')
+
def test_reservedProperties(self):
self.open_database()
self.assertRaises(ValueError, self.module.Class, self.db, "a",
diff --git a/test/memorydb.py b/test/memorydb.py
index 9565050bef68405d3c0eebf54969369261a0b0e3..17c8330f7c3029c86363a3603a04f1a84111e97c 100644 (file)
--- a/test/memorydb.py
+++ b/test/memorydb.py
self.sessions = Sessions()
self.otks = OneTimeKeys()
self.indexer = Indexer(self)
- self.sessions = Sessions()
# anydbm bits
self.cache = {} # cache of nodes loaded or created
self.destroyednodes = {}# keep track of the destroyed nodes by class
self.transactions = []
-
def filename(self, classname, nodeid, property=None, create=0):
shutil.copyfile(__file__, __file__+'.dummy')
return __file__+'.dummy'
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index ca3419f90510d7bc361dc0fd6d2a000b0a181e21..b1e4db93c82a29b5254e5eedb8efe4360b55e937 100644 (file)
--- a/test/test_mailgw.py
+++ b/test/test_mailgw.py
os.remove(SENDMAILDEBUG)
self.db.close()
+ def _create_mailgw(self, message):
+ class MailGW(self.instance.MailGW):
+ def handle_message(self, message):
+ return self._handle_message(message)
+ handler = MailGW(self.instance)
+ handler.db = self.db
+ return handler
+
def _handle_mail(self, message):
- handler = self.instance.MailGW(self.instance)
+ handler = self._create_mailgw(message)
handler.trapExceptions = 0
return handler.main(StringIO(message))
# reconstruct old behaviour: This would reuse the
# database-handle from the doNewIssue above which has committed
# as user "Chef". So we close and reopen the db as that user.
- self.db.close()
+ #self.db.close() actually don't close 'cos this empties memorydb
self.db = self.instance.open('Chef')
self.db.issue.set('1', assignedto=self.chef_id)
self.db.commit()
assert not os.path.exists(SENDMAILDEBUG)
def testNewUserAuthor(self):
+ self.db.commit()
l = self.db.user.list()
l.sort()
message = '''Content-Type: text/plain;
This is a test submission of a new issue.
'''
- self.db.close()
- handler = self.instance.MailGW(self.instance)
+ handler = self._create_mailgw(message)
# we want a bounce message:
handler.trapExceptions = 1
ret = handler.main(StringIO(message))