summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd4bb53)
raw | patch | inline | side by side (parent: bd4bb53)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 5 Aug 2001 07:45:27 +0000 (07:45 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 5 Aug 2001 07:45:27 +0000 (07:45 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@211 57a73879-2fb5-44c3-a270-3262357dd7e2
test/__init__.py | patch | blob | history | |
test/test_init.py | patch | blob | history |
diff --git a/test/__init__.py b/test/__init__.py
index 5a9df6f50b7d3b51c0d0b22add04da1ac6547bde..aa8f8b5e63e24128c9dda323a012ae47db213b47 100644 (file)
--- a/test/__init__.py
+++ b/test/__init__.py
-# $Id: __init__.py,v 1.4 2001-08-03 07:18:22 richard Exp $
+# $Id: __init__.py,v 1.5 2001-08-05 07:45:27 richard Exp $
import unittest
import test_dates, test_schema, test_db, test_multipart, test_mailsplit
+import test_init
def go():
suite = unittest.TestSuite((
test_dates.suite(),
test_schema.suite(),
test_db.suite(),
+ test_init.suite(),
test_multipart.suite(),
test_mailsplit.suite(),
))
#
# $Log: not supported by cvs2svn $
+# Revision 1.4 2001/08/03 07:18:22 richard
+# Implemented correct mail splitting (was taking a shortcut). Added unit
+# tests. Also snips signatures now too.
+#
# Revision 1.3 2001/07/29 07:01:39 richard
# Added vim command to all source so that we don't get no steenkin' tabs :)
#
diff --git a/test/test_init.py b/test/test_init.py
index 06d792cf06ab992595c27d228cf79f7851c8bdf1..f9430946e54c799e4da3e9a20cfdb1ee834b9348 100644 (file)
--- a/test/test_init.py
+++ b/test/test_init.py
-# $Id: test_init.py,v 1.1 2001-08-05 07:07:58 richard Exp $
+# $Id: test_init.py,v 1.2 2001-08-05 07:45:27 richard Exp $
import unittest, os, shutil, errno, imp, sys
from roundup.init import init
class MyTestCase(unittest.TestCase):
+ count = 0
+ def setUp(self):
+ MyTestCase.count = MyTestCase.count + 1
+ self.dirname = '_test_%s'%self.count
+ try:
+ shutil.rmtree(self.dirname)
+ except OSError, error:
+ if error.errno != errno.ENOENT: raise
+
def tearDown(self):
try:
- shutil.rmtree('_test_dir')
+ shutil.rmtree(self.dirname)
except OSError, error:
- if error.errno == errno.ENOENT: raise
+ if error.errno != errno.ENOENT: raise
class ClassicTestCase(MyTestCase):
backend = 'anydbm'
ae = self.assertEqual
# create the instance
- init('_test_dir', 'classic', self.backend, 'sekrit')
+ init(self.dirname, 'classic', self.backend, 'sekrit')
# check we can load the package
- instance = imp.load_package('_test_dir', '_test_dir')
+ instance = imp.load_package(self.dirname, self.dirname)
# and open the database
db = instance.open()
ae = self.assertEqual
# create the instance
- init('_test_dir', 'extended', self.backend, 'sekrit')
+ init(self.dirname, 'extended', self.backend, 'sekrit')
# check we can load the package
- del sys.modules['_test_dir']
- instance = imp.load_package('_test_dir', '_test_dir')
+ instance = imp.load_package(self.dirname, self.dirname)
# and open the database
db = instance.open()
# check the basics of the schema and initial data set
l = db.priority.list()
- ae(l, ['1', '2', '3', '4', '5'])
+ ae(l, ['1', '2', '3', '4'])
l = db.status.list()
ae(l, ['1', '2', '3', '4', '5', '6', '7', '8'])
l = db.keyword.list()
#
# $Log: not supported by cvs2svn $
+# Revision 1.1 2001/08/05 07:07:58 richard
+# added tests for roundup.init - but they're disabled until I can figure _if_
+# we can run them (import problems).
+#
#
#
# vim: set filetype=python ts=4 sw=4 et si