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