summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 51ce157)
raw | patch | inline | side by side (parent: 51ce157)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 14 Feb 2002 23:38:12 +0000 (23:38 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 14 Feb 2002 23:38:12 +0000 (23:38 +0000) |
Also made the test runner more user-friendly:
./run_tests - detect all tests in test/test_<name>.py and run them
./run_tests <name> - run only test/test_<name>.py
eg ./run_tests mailgw - run the mailgw test from test/test_mailgw.py
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@625 57a73879-2fb5-44c3-a270-3262357dd7e2
./run_tests - detect all tests in test/test_<name>.py and run them
./run_tests <name> - run only test/test_<name>.py
eg ./run_tests mailgw - run the mailgw test from test/test_mailgw.py
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@625 57a73879-2fb5-44c3-a270-3262357dd7e2
run_tests | patch | blob | history | |
test/__init__.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/run_tests b/run_tests
index 0bfc161bc9ed11f3b6c6a2eb8fe1dd660719b288..032b7c96cfaeaf617d0189e7f46be88a580d127a 100755 (executable)
--- a/run_tests
+++ b/run_tests
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: run_tests,v 1.3 2002-01-23 20:09:41 jhermann Exp $
+# $Id: run_tests,v 1.4 2002-02-14 23:38:12 richard Exp $
-import test
-test.go()
+from test import go
+import sys
+if len(sys.argv) > 1:
+ go(sys.argv[1:])
+else:
+ go()
#
# $Log: not supported by cvs2svn $
+# Revision 1.3 2002/01/23 20:09:41 jhermann
+# Proper fix for failing test
+#
# Revision 1.2 2002/01/23 11:08:52 grubert
# . run_tests testReldate_date failed if LANG is 'german'
#
diff --git a/test/__init__.py b/test/__init__.py
index 8b55c40571947118bcea209144bb82a1c6c16ff8..749ba6777c10323966c23165d9e22aaf38406b1a 100644 (file)
--- a/test/__init__.py
+++ b/test/__init__.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: __init__.py,v 1.15 2002-01-22 00:12:20 richard Exp $
+# $Id: __init__.py,v 1.16 2002-02-14 23:38:12 richard Exp $
-import unittest
-import os, tempfile
+import os, tempfile, unittest, shutil
os.environ['SENDMAILDEBUG'] = tempfile.mktemp()
-import test_dates, test_schema, test_db, test_multipart, test_mailsplit
-import test_init, test_token, test_mailgw, test_htmltemplate
+# figure all the modules available
+dir = os.path.split(__file__)[0]
+test_mods = {}
+for file in os.listdir(dir):
+ if file.startswith('test_') and file.endswith('.py'):
+ name = file[5:-3]
+ test_mods[name] = __import__(file[:-3], globals(), locals(), [])
+all_tests = test_mods.keys()
-def go():
- suite = unittest.TestSuite((
- test_dates.suite(),
- test_schema.suite(),
- test_db.suite(),
- test_init.suite(),
- test_multipart.suite(),
- test_mailsplit.suite(),
- test_mailgw.suite(),
- test_token.suite(),
- test_htmltemplate.suite(),
- ))
+def go(tests=all_tests):
+ l = []
+ for name in tests:
+ l.append(test_mods[name].suite())
+ suite = unittest.TestSuite(l)
runner = unittest.TextTestRunner()
- result = runner.run(suite)
- return result.wasSuccessful()
+ runner.run(suite)
#
# $Log: not supported by cvs2svn $
+# Revision 1.15 2002/01/22 00:12:20 richard
+# oops
+#
# Revision 1.14 2002/01/22 00:12:06 richard
# Wrote more unit tests for htmltemplate, and while I was at it, I polished
# off the implementation of some of the functions so they behave sanely.
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index e1a750858d01bd863cfe125a2c59c8abc4053db4..58dda70f399fbabc71ddd27110557e01f7816fa6 100644 (file)
--- a/test/test_mailgw.py
+++ b/test/test_mailgw.py
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test_mailgw.py,v 1.10 2002-02-12 08:08:55 grubert Exp $
+# $Id: test_mailgw.py,v 1.11 2002-02-14 23:38:12 richard Exp $
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys
Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
MIME-Version: 1.0
Message-Id: <dummy_test_message_id>
+X-Roundup-Name: Roundup issue tracker
New submission from Chef <chef@bork.bork.bork>:
# the ip address of the test machine.
# BUG should test some binary attamchent too.
-
+
def testFollowup(self):
self.testNewIssue()
message = cStringIO.StringIO('''Content-Type: text/plain;
MIME-Version: 1.0
Message-Id: <followup_dummy_id>
In-Reply-To: <dummy_test_message_id>
+X-Roundup-Name: Roundup issue tracker
richard <richard@test> added the comment:
MIME-Version: 1.0
Message-Id: <followup_dummy_id>
In-Reply-To: <dummy_test_message_id>
+X-Roundup-Name: Roundup issue tracker
mary <mary@test> added the comment:
MIME-Version: 1.0
Message-Id: <followup_dummy_id>
In-Reply-To: <dummy_test_message_id>
+X-Roundup-Name: Roundup issue tracker
mary <mary@test> added the comment:
MIME-Version: 1.0
Message-Id: <followup_dummy_id>
In-Reply-To: <dummy_test_message_id>
+X-Roundup-Name: Roundup issue tracker
mary <mary@test> added the comment:
#
# $Log: not supported by cvs2svn $
+# Revision 1.10 2002/02/12 08:08:55 grubert
+# . Clean up mail handling, multipart handling.
+#
# Revision 1.9 2002/02/05 14:15:29 grubert
# . respect encodings in non multipart messages.
#