annotate test/__init__.py @ 718:e10c37f53efd

fixed SCRIPT_NAME in ZRoundup for instances not at top level of Zope (thanks dman) fixed some sorting issues that were breaking some unit tests under py2.2 mailgw test output dir was confusing the init test (but only on 2.2 *shrug*) fixed bug in the init unit test that meant only the bsddb test ran if it could (it clobbered the anydbm test)
author Richard Jones <richard@users.sourceforge.net>
date Wed, 15 May 2002 03:27:16 +0000
parents d77b82588bf0
children 938edfdeac6e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
213
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
1 #
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
3 # This module is free software, and you may redistribute it and/or modify
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
4 # under the same terms as Python, so long as this copyright message and
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
5 # disclaimer are retained in their original form.
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
6 #
214
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
213
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
10 # POSSIBILITY OF SUCH DAMAGE.
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
11 #
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
17 #
613
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
18 # $Id: __init__.py,v 1.16 2002-02-14 23:38:12 richard Exp $
92
fa44da8d9df2 moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
19
613
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
20 import os, tempfile, unittest, shutil
475
a1a44636bace Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents: 470
diff changeset
21 os.environ['SENDMAILDEBUG'] = tempfile.mktemp()
92
fa44da8d9df2 moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
22
613
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
23 # figure all the modules available
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
24 dir = os.path.split(__file__)[0]
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
25 test_mods = {}
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
26 for file in os.listdir(dir):
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
27 if file.startswith('test_') and file.endswith('.py'):
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
28 name = file[5:-3]
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
29 test_mods[name] = __import__(file[:-3], globals(), locals(), [])
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
30 all_tests = test_mods.keys()
92
fa44da8d9df2 moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
31
613
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
32 def go(tests=all_tests):
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
33 l = []
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
34 for name in tests:
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
35 l.append(test_mods[name].suite())
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
36 suite = unittest.TestSuite(l)
92
fa44da8d9df2 moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
37 runner = unittest.TextTestRunner()
613
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
38 runner.run(suite)
92
fa44da8d9df2 moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
39
fa44da8d9df2 moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
40 #
fa44da8d9df2 moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
41 # $Log: not supported by cvs2svn $
613
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
42 # Revision 1.15 2002/01/22 00:12:20 richard
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
43 # oops
d77b82588bf0 Fixed the unit tests for the mailgw re: the x-roundup-name header.
Richard Jones <richard@users.sourceforge.net>
parents: 564
diff changeset
44 #
564
Richard Jones <richard@users.sourceforge.net>
parents: 563
diff changeset
45 # Revision 1.14 2002/01/22 00:12:06 richard
Richard Jones <richard@users.sourceforge.net>
parents: 563
diff changeset
46 # Wrote more unit tests for htmltemplate, and while I was at it, I polished
Richard Jones <richard@users.sourceforge.net>
parents: 563
diff changeset
47 # off the implementation of some of the functions so they behave sanely.
Richard Jones <richard@users.sourceforge.net>
parents: 563
diff changeset
48 #
563
0f58d6a35a8b Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents: 561
diff changeset
49 # Revision 1.13 2002/01/21 11:05:48 richard
0f58d6a35a8b Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents: 561
diff changeset
50 # New tests for htmltemplate (well, it's a beginning)
0f58d6a35a8b Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents: 561
diff changeset
51 #
561
13df980755fa New tests for htmltemplate (well, it's a beginning)
Richard Jones <richard@users.sourceforge.net>
parents: 530
diff changeset
52 # Revision 1.12 2002/01/14 06:53:28 richard
13df980755fa New tests for htmltemplate (well, it's a beginning)
Richard Jones <richard@users.sourceforge.net>
parents: 530
diff changeset
53 # had commented out some tests
13df980755fa New tests for htmltemplate (well, it's a beginning)
Richard Jones <richard@users.sourceforge.net>
parents: 530
diff changeset
54 #
530
074bac7fc308 had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents: 524
diff changeset
55 # Revision 1.11 2002/01/14 02:20:15 richard
074bac7fc308 had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents: 524
diff changeset
56 # . changed all config accesses so they access either the instance or the
074bac7fc308 had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents: 524
diff changeset
57 # config attriubute on the db. This means that all config is obtained from
074bac7fc308 had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents: 524
diff changeset
58 # instance_config instead of the mish-mash of classes. This will make
074bac7fc308 had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents: 524
diff changeset
59 # switching to a ConfigParser setup easier too, I hope.
074bac7fc308 had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents: 524
diff changeset
60 #
074bac7fc308 had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents: 524
diff changeset
61 # At a minimum, this makes migration a _little_ easier (a lot easier in the
074bac7fc308 had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents: 524
diff changeset
62 # 0.5.0 switch, I hope!)
074bac7fc308 had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents: 524
diff changeset
63 #
524
dce4c75bef5a changed all config accesses...
Richard Jones <richard@users.sourceforge.net>
parents: 483
diff changeset
64 # Revision 1.10 2002/01/05 02:09:46 richard
dce4c75bef5a changed all config accesses...
Richard Jones <richard@users.sourceforge.net>
parents: 483
diff changeset
65 # make setup abort if tests fail
dce4c75bef5a changed all config accesses...
Richard Jones <richard@users.sourceforge.net>
parents: 483
diff changeset
66 #
483
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
67 # Revision 1.9 2002/01/02 02:31:38 richard
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
68 # Sorry for the huge checkin message - I was only intending to implement #496356
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
69 # but I found a number of places where things had been broken by transactions:
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
70 # . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
71 # for _all_ roundup-generated smtp messages to be sent to.
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
72 # . the transaction cache had broken the roundupdb.Class set() reactors
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
73 # . newly-created author users in the mailgw weren't being committed to the db
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
74 #
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
75 # Stuff that made it into CHANGES.txt (ie. the stuff I was actually working
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
76 # on when I found that stuff :):
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
77 # . #496356 ] Use threading in messages
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
78 # . detectors were being registered multiple times
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
79 # . added tests for mailgw
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
80 # . much better attaching of erroneous messages in the mail gateway
a090b3873d82 make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents: 475
diff changeset
81 #
475
a1a44636bace Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents: 470
diff changeset
82 # Revision 1.8 2001/12/31 05:09:20 richard
a1a44636bace Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents: 470
diff changeset
83 # Added better tokenising to roundup-admin - handles spaces and stuff. Can
a1a44636bace Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents: 470
diff changeset
84 # use quoting or backslashes. See the roundup.token pydoc.
a1a44636bace Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents: 470
diff changeset
85 #
470
9f7320624bc2 Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
86 # Revision 1.7 2001/08/07 00:24:43 richard
9f7320624bc2 Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
87 # stupid typo
9f7320624bc2 Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
88 #
214
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
89 # Revision 1.6 2001/08/07 00:15:51 richard
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
90 # Added the copyright/license notice to (nearly) all files at request of
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
91 # Bizar Software.
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
92 #
213
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
93 # Revision 1.5 2001/08/05 07:45:27 richard
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
94 # Added tests for instance initialisation
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 205
diff changeset
95 #
205
da2e5d340e14 Added tests for instance initialisation
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
96 # Revision 1.4 2001/08/03 07:18:22 richard
da2e5d340e14 Added tests for instance initialisation
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
97 # Implemented correct mail splitting (was taking a shortcut). Added unit
da2e5d340e14 Added tests for instance initialisation
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
98 # tests. Also snips signatures now too.
da2e5d340e14 Added tests for instance initialisation
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
99 #
198
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents: 127
diff changeset
100 # Revision 1.3 2001/07/29 07:01:39 richard
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents: 127
diff changeset
101 # Added vim command to all source so that we don't get no steenkin' tabs :)
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents: 127
diff changeset
102 #
127
0791d13baea7 Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents: 110
diff changeset
103 # Revision 1.2 2001/07/28 06:43:02 richard
0791d13baea7 Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents: 110
diff changeset
104 # Multipart message class has the getPart method now. Added some tests for it.
0791d13baea7 Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents: 110
diff changeset
105 #
110
19686b60e410 Multipart message class has the getPart method now. Added some tests for it.
Richard Jones <richard@users.sourceforge.net>
parents: 92
diff changeset
106 # Revision 1.1 2001/07/27 06:55:07 richard
19686b60e410 Multipart message class has the getPart method now. Added some tests for it.
Richard Jones <richard@users.sourceforge.net>
parents: 92
diff changeset
107 # moving tests -> test
19686b60e410 Multipart message class has the getPart method now. Added some tests for it.
Richard Jones <richard@users.sourceforge.net>
parents: 92
diff changeset
108 #
92
fa44da8d9df2 moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
109 # Revision 1.3 2001/07/25 04:34:31 richard
fa44da8d9df2 moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
110 # Added id and log to tests files...
fa44da8d9df2 moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
111 #
fa44da8d9df2 moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
112 #
127
0791d13baea7 Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents: 110
diff changeset
113 # vim: set filetype=python ts=4 sw=4 et si

Roundup Issue Tracker: http://roundup-tracker.org/