Code

Fixed the unit tests for the mailgw re: the x-roundup-name header.
[roundup.git] / test / __init__.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: __init__.py,v 1.16 2002-02-14 23:38:12 richard Exp $
20 import os, tempfile, unittest, shutil
21 os.environ['SENDMAILDEBUG'] = tempfile.mktemp()
23 # figure all the modules available
24 dir = os.path.split(__file__)[0]
25 test_mods = {}
26 for file in os.listdir(dir):
27     if file.startswith('test_') and file.endswith('.py'):
28         name = file[5:-3]
29         test_mods[name] = __import__(file[:-3], globals(), locals(), [])
30 all_tests = test_mods.keys()
32 def go(tests=all_tests):
33     l = []
34     for name in tests:
35         l.append(test_mods[name].suite())
36     suite = unittest.TestSuite(l)
37     runner = unittest.TextTestRunner()
38     runner.run(suite)
40 #
41 # $Log: not supported by cvs2svn $
42 # Revision 1.15  2002/01/22 00:12:20  richard
43 # oops
44 #
45 # Revision 1.14  2002/01/22 00:12:06  richard
46 # Wrote more unit tests for htmltemplate, and while I was at it, I polished
47 # off the implementation of some of the functions so they behave sanely.
48 #
49 # Revision 1.13  2002/01/21 11:05:48  richard
50 # New tests for htmltemplate (well, it's a beginning)
51 #
52 # Revision 1.12  2002/01/14 06:53:28  richard
53 # had commented out some tests
54 #
55 # Revision 1.11  2002/01/14 02:20:15  richard
56 #  . changed all config accesses so they access either the instance or the
57 #    config attriubute on the db. This means that all config is obtained from
58 #    instance_config instead of the mish-mash of classes. This will make
59 #    switching to a ConfigParser setup easier too, I hope.
60 #
61 # At a minimum, this makes migration a _little_ easier (a lot easier in the
62 # 0.5.0 switch, I hope!)
63 #
64 # Revision 1.10  2002/01/05 02:09:46  richard
65 # make setup abort if tests fail
66 #
67 # Revision 1.9  2002/01/02 02:31:38  richard
68 # Sorry for the huge checkin message - I was only intending to implement #496356
69 # but I found a number of places where things had been broken by transactions:
70 #  . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename
71 #    for _all_ roundup-generated smtp messages to be sent to.
72 #  . the transaction cache had broken the roundupdb.Class set() reactors
73 #  . newly-created author users in the mailgw weren't being committed to the db
74 #
75 # Stuff that made it into CHANGES.txt (ie. the stuff I was actually working
76 # on when I found that stuff :):
77 #  . #496356 ] Use threading in messages
78 #  . detectors were being registered multiple times
79 #  . added tests for mailgw
80 #  . much better attaching of erroneous messages in the mail gateway
81 #
82 # Revision 1.8  2001/12/31 05:09:20  richard
83 # Added better tokenising to roundup-admin - handles spaces and stuff. Can
84 # use quoting or backslashes. See the roundup.token pydoc.
85 #
86 # Revision 1.7  2001/08/07 00:24:43  richard
87 # stupid typo
88 #
89 # Revision 1.6  2001/08/07 00:15:51  richard
90 # Added the copyright/license notice to (nearly) all files at request of
91 # Bizar Software.
92 #
93 # Revision 1.5  2001/08/05 07:45:27  richard
94 # Added tests for instance initialisation
95 #
96 # Revision 1.4  2001/08/03 07:18:22  richard
97 # Implemented correct mail splitting (was taking a shortcut). Added unit
98 # tests. Also snips signatures now too.
99 #
100 # Revision 1.3  2001/07/29 07:01:39  richard
101 # Added vim command to all source so that we don't get no steenkin' tabs :)
103 # Revision 1.2  2001/07/28 06:43:02  richard
104 # Multipart message class has the getPart method now. Added some tests for it.
106 # Revision 1.1  2001/07/27 06:55:07  richard
107 # moving tests -> test
109 # Revision 1.3  2001/07/25 04:34:31  richard
110 # Added id and log to tests files...
113 # vim: set filetype=python ts=4 sw=4 et si