Mercurial > p > roundup > code
annotate test/__init__.py @ 897:65090a899a19 maint-0.4 0.4.3
Clarification.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 25 Jul 2002 02:09:35 +0000 |
| parents | 938edfdeac6e |
| children | 9b910e8d987d |
| 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 | 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 # |
|
753
938edfdeac6e
Sorry about this huge checkin!
Richard Jones <richard@users.sourceforge.net>
parents:
613
diff
changeset
|
18 # $Id: __init__.py,v 1.17 2002-05-29 01:16:17 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 |
|
753
938edfdeac6e
Sorry about this huge checkin!
Richard Jones <richard@users.sourceforge.net>
parents:
613
diff
changeset
|
21 import roundup.roundupdb |
|
938edfdeac6e
Sorry about this huge checkin!
Richard Jones <richard@users.sourceforge.net>
parents:
613
diff
changeset
|
22 roundup.roundupdb.SENDMAILDEBUG=os.environ['SENDMAILDEBUG']=tempfile.mktemp() |
|
92
fa44da8d9df2
moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
23 |
|
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
|
24 # 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
|
25 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
|
26 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
|
27 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
|
28 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
|
29 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
|
30 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
|
31 all_tests = test_mods.keys() |
|
92
fa44da8d9df2
moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
32 |
|
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
|
33 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
|
34 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
|
35 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
|
36 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
|
37 suite = unittest.TestSuite(l) |
|
92
fa44da8d9df2
moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
38 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
|
39 runner.run(suite) |
|
92
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 # |
|
fa44da8d9df2
moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
42 # $Log: not supported by cvs2svn $ |
|
753
938edfdeac6e
Sorry about this huge checkin!
Richard Jones <richard@users.sourceforge.net>
parents:
613
diff
changeset
|
43 # Revision 1.16 2002/02/14 23:38:12 richard |
|
938edfdeac6e
Sorry about this huge checkin!
Richard Jones <richard@users.sourceforge.net>
parents:
613
diff
changeset
|
44 # Fixed the unit tests for the mailgw re: the x-roundup-name header. |
|
938edfdeac6e
Sorry about this huge checkin!
Richard Jones <richard@users.sourceforge.net>
parents:
613
diff
changeset
|
45 # Also made the test runner more user-friendly: |
|
938edfdeac6e
Sorry about this huge checkin!
Richard Jones <richard@users.sourceforge.net>
parents:
613
diff
changeset
|
46 # ./run_tests - detect all tests in test/test_<name>.py and run them |
|
938edfdeac6e
Sorry about this huge checkin!
Richard Jones <richard@users.sourceforge.net>
parents:
613
diff
changeset
|
47 # ./run_tests <name> - run only test/test_<name>.py |
|
938edfdeac6e
Sorry about this huge checkin!
Richard Jones <richard@users.sourceforge.net>
parents:
613
diff
changeset
|
48 # eg ./run_tests mailgw - run the mailgw test from test/test_mailgw.py |
|
938edfdeac6e
Sorry about this huge checkin!
Richard Jones <richard@users.sourceforge.net>
parents:
613
diff
changeset
|
49 # |
|
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
|
50 # 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
|
51 # 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
|
52 # |
| 564 | 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 # | |
|
563
0f58d6a35a8b
Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents:
561
diff
changeset
|
57 # 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
|
58 # 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
|
59 # |
|
561
13df980755fa
New tests for htmltemplate (well, it's a beginning)
Richard Jones <richard@users.sourceforge.net>
parents:
530
diff
changeset
|
60 # 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
|
61 # 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
|
62 # |
|
530
074bac7fc308
had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
63 # 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
|
64 # . 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
|
65 # 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
|
66 # 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
|
67 # 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
|
68 # |
|
074bac7fc308
had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
69 # 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
|
70 # 0.5.0 switch, I hope!) |
|
074bac7fc308
had commented out some tests
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
71 # |
|
524
dce4c75bef5a
changed all config accesses...
Richard Jones <richard@users.sourceforge.net>
parents:
483
diff
changeset
|
72 # 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
|
73 # make setup abort if tests fail |
|
dce4c75bef5a
changed all config accesses...
Richard Jones <richard@users.sourceforge.net>
parents:
483
diff
changeset
|
74 # |
|
483
a090b3873d82
make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
75 # 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
|
76 # 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
|
77 # 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
|
78 # . 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
|
79 # 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
|
80 # . 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
|
81 # . 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
|
82 # |
|
a090b3873d82
make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
83 # 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
|
84 # on when I found that stuff :): |
|
a090b3873d82
make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
85 # . #496356 ] Use threading in messages |
|
a090b3873d82
make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
86 # . detectors were being registered multiple times |
|
a090b3873d82
make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
87 # . added tests for mailgw |
|
a090b3873d82
make setup abort if tests fail
Richard Jones <richard@users.sourceforge.net>
parents:
475
diff
changeset
|
88 # . 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
|
89 # |
|
475
a1a44636bace
Fix breakage caused by transaction changes.
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
90 # 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
|
91 # 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
|
92 # 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
|
93 # |
|
470
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
94 # 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
|
95 # stupid typo |
|
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
96 # |
| 214 | 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 # | |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
205
diff
changeset
|
101 # 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
|
102 # 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
|
103 # |
|
205
da2e5d340e14
Added tests for instance initialisation
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
104 # 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
|
105 # 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
|
106 # tests. Also snips signatures now too. |
|
da2e5d340e14
Added tests for instance initialisation
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
107 # |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
108 # 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
|
109 # 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
|
110 # |
|
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
|
111 # 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
|
112 # 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
|
113 # |
|
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
|
114 # 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
|
115 # 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
|
116 # |
|
92
fa44da8d9df2
moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
117 # Revision 1.3 2001/07/25 04:34:31 richard |
|
fa44da8d9df2
moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
118 # Added id and log to tests files... |
|
fa44da8d9df2
moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
119 # |
|
fa44da8d9df2
moving tests -> test
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
120 # |
|
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
|
121 # vim: set filetype=python ts=4 sw=4 et si |
