Benjamin Peterson | ee8712c | 2008-05-20 21:35:26 +0000 | [diff] [blame] | 1 | from test.support import run_unittest |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 2 | import cgi |
| 3 | import os |
| 4 | import sys |
Thomas Wouters | 00ee7ba | 2006-08-21 19:07:27 +0000 | [diff] [blame] | 5 | import tempfile |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 6 | import unittest |
Guido van Rossum | 34d1928 | 2007-08-09 01:03:29 +0000 | [diff] [blame] | 7 | from io import StringIO |
Facundo Batista | a27244b | 2008-09-09 02:43:19 +0000 | [diff] [blame] | 8 | from warnings import catch_warnings, filterwarnings |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 9 | |
| 10 | class HackedSysModule: |
| 11 | # The regression test will have real values in sys.argv, which |
Fred Drake | 004d5e6 | 2000-10-23 17:22:08 +0000 | [diff] [blame] | 12 | # will completely confuse the test of the cgi module |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 13 | argv = [] |
| 14 | stdin = sys.stdin |
| 15 | |
| 16 | cgi.sys = HackedSysModule() |
| 17 | |
| 18 | try: |
Guido van Rossum | 34d1928 | 2007-08-09 01:03:29 +0000 | [diff] [blame] | 19 | from io import StringIO |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 20 | except ImportError: |
Guido van Rossum | 34d1928 | 2007-08-09 01:03:29 +0000 | [diff] [blame] | 21 | from io import StringIO |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 22 | |
| 23 | class ComparableException: |
| 24 | def __init__(self, err): |
| 25 | self.err = err |
| 26 | |
| 27 | def __str__(self): |
| 28 | return str(self.err) |
| 29 | |
Guido van Rossum | 47b9ff6 | 2006-08-24 00:41:19 +0000 | [diff] [blame] | 30 | def __eq__(self, anExc): |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 31 | if not isinstance(anExc, Exception): |
Guido van Rossum | 47b9ff6 | 2006-08-24 00:41:19 +0000 | [diff] [blame] | 32 | return NotImplemented |
| 33 | return (self.err.__class__ == anExc.__class__ and |
| 34 | self.err.args == anExc.args) |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 35 | |
| 36 | def __getattr__(self, attr): |
Guido van Rossum | 846d6db | 2001-01-17 15:08:37 +0000 | [diff] [blame] | 37 | return getattr(self.err, attr) |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 38 | |
| 39 | def do_test(buf, method): |
| 40 | env = {} |
| 41 | if method == "GET": |
| 42 | fp = None |
| 43 | env['REQUEST_METHOD'] = 'GET' |
| 44 | env['QUERY_STRING'] = buf |
| 45 | elif method == "POST": |
| 46 | fp = StringIO(buf) |
| 47 | env['REQUEST_METHOD'] = 'POST' |
| 48 | env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded' |
| 49 | env['CONTENT_LENGTH'] = str(len(buf)) |
| 50 | else: |
Collin Winter | 3add4d7 | 2007-08-29 23:37:32 +0000 | [diff] [blame] | 51 | raise ValueError("unknown method: %s" % method) |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 52 | try: |
| 53 | return cgi.parse(fp, env, strict_parsing=1) |
Guido van Rossum | cd16bf6 | 2007-06-13 18:07:49 +0000 | [diff] [blame] | 54 | except Exception as err: |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 55 | return ComparableException(err) |
| 56 | |
Neil Schemenauer | 66edb62 | 2004-07-19 15:38:11 +0000 | [diff] [blame] | 57 | parse_strict_test_cases = [ |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 58 | ("", ValueError("bad query field: ''")), |
| 59 | ("&", ValueError("bad query field: ''")), |
| 60 | ("&&", ValueError("bad query field: ''")), |
Jeremy Hylton | afde7e2 | 2000-09-15 20:06:57 +0000 | [diff] [blame] | 61 | (";", ValueError("bad query field: ''")), |
| 62 | (";&;", ValueError("bad query field: ''")), |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 63 | # Should the next few really be valid? |
| 64 | ("=", {}), |
| 65 | ("=&=", {}), |
Jeremy Hylton | afde7e2 | 2000-09-15 20:06:57 +0000 | [diff] [blame] | 66 | ("=;=", {}), |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 67 | # This rest seem to make sense |
| 68 | ("=a", {'': ['a']}), |
| 69 | ("&=a", ValueError("bad query field: ''")), |
| 70 | ("=a&", ValueError("bad query field: ''")), |
| 71 | ("=&a", ValueError("bad query field: 'a'")), |
| 72 | ("b=a", {'b': ['a']}), |
| 73 | ("b+=a", {'b ': ['a']}), |
| 74 | ("a=b=a", {'a': ['b=a']}), |
| 75 | ("a=+b=a", {'a': [' b=a']}), |
| 76 | ("&b=a", ValueError("bad query field: ''")), |
| 77 | ("b&=a", ValueError("bad query field: 'b'")), |
| 78 | ("a=a+b&b=b+c", {'a': ['a b'], 'b': ['b c']}), |
| 79 | ("a=a+b&a=b+a", {'a': ['a b', 'b a']}), |
| 80 | ("x=1&y=2.0&z=2-3.%2b0", {'x': ['1'], 'y': ['2.0'], 'z': ['2-3.+0']}), |
Jeremy Hylton | afde7e2 | 2000-09-15 20:06:57 +0000 | [diff] [blame] | 81 | ("x=1;y=2.0&z=2-3.%2b0", {'x': ['1'], 'y': ['2.0'], 'z': ['2-3.+0']}), |
| 82 | ("x=1;y=2.0;z=2-3.%2b0", {'x': ['1'], 'y': ['2.0'], 'z': ['2-3.+0']}), |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 83 | ("Hbc5161168c542333633315dee1182227:key_store_seqid=400006&cuyer=r&view=bustomer&order_id=0bb2e248638833d48cb7fed300000f1b&expire=964546263&lobale=en-US&kid=130003.300038&ss=env", |
| 84 | {'Hbc5161168c542333633315dee1182227:key_store_seqid': ['400006'], |
| 85 | 'cuyer': ['r'], |
| 86 | 'expire': ['964546263'], |
| 87 | 'kid': ['130003.300038'], |
| 88 | 'lobale': ['en-US'], |
| 89 | 'order_id': ['0bb2e248638833d48cb7fed300000f1b'], |
| 90 | 'ss': ['env'], |
| 91 | 'view': ['bustomer'], |
| 92 | }), |
Fred Drake | 004d5e6 | 2000-10-23 17:22:08 +0000 | [diff] [blame] | 93 | |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 94 | ("group_id=5470&set=custom&_assigned_to=31392&_status=1&_category=100&SUBMIT=Browse", |
| 95 | {'SUBMIT': ['Browse'], |
| 96 | '_assigned_to': ['31392'], |
| 97 | '_category': ['100'], |
| 98 | '_status': ['1'], |
| 99 | 'group_id': ['5470'], |
| 100 | 'set': ['custom'], |
| 101 | }) |
| 102 | ] |
| 103 | |
Guido van Rossum | 47b9ff6 | 2006-08-24 00:41:19 +0000 | [diff] [blame] | 104 | def norm(seq): |
Guido van Rossum | cc2b016 | 2007-02-11 06:12:03 +0000 | [diff] [blame] | 105 | return sorted(seq, key=repr) |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 106 | |
| 107 | def first_elts(list): |
Guido van Rossum | c1f779c | 2007-07-03 08:25:58 +0000 | [diff] [blame] | 108 | return [p[0] for p in list] |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 109 | |
| 110 | def first_second_elts(list): |
Guido van Rossum | c1f779c | 2007-07-03 08:25:58 +0000 | [diff] [blame] | 111 | return [(p[0], p[1][0]) for p in list] |
| 112 | |
Benjamin Peterson | dcf97b9 | 2008-07-02 17:30:14 +0000 | [diff] [blame] | 113 | def gen_result(data, environ): |
| 114 | fake_stdin = StringIO(data) |
| 115 | fake_stdin.seek(0) |
| 116 | form = cgi.FieldStorage(fp=fake_stdin, environ=environ) |
| 117 | |
| 118 | result = {} |
| 119 | for k, v in dict(form).items(): |
| 120 | result[k] = type(v) is list and form.getlist(k) or v.value |
| 121 | |
| 122 | return result |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 123 | |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 124 | class CgiTests(unittest.TestCase): |
Neil Schemenauer | 66edb62 | 2004-07-19 15:38:11 +0000 | [diff] [blame] | 125 | |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 126 | def test_strict(self): |
| 127 | for orig, expect in parse_strict_test_cases: |
| 128 | # Test basic parsing |
| 129 | d = do_test(orig, "GET") |
| 130 | self.assertEqual(d, expect, "Error parsing %s" % repr(orig)) |
| 131 | d = do_test(orig, "POST") |
| 132 | self.assertEqual(d, expect, "Error parsing %s" % repr(orig)) |
| 133 | |
| 134 | env = {'QUERY_STRING': orig} |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 135 | fs = cgi.FieldStorage(environ=env) |
| 136 | if type(expect) == type({}): |
| 137 | # test dict interface |
Georg Brandl | 49d1b4f | 2008-05-11 21:42:51 +0000 | [diff] [blame] | 138 | self.assertEqual(len(expect), len(fs)) |
| 139 | self.assertEqual(norm(expect.keys()), norm(fs.keys())) |
| 140 | ##self.assertEqual(norm(expect.values()), norm(fs.values())) |
| 141 | ##self.assertEqual(norm(expect.items()), norm(fs.items())) |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 142 | self.assertEqual(fs.getvalue("nonexistent field", "default"), "default") |
| 143 | # test individual fields |
| 144 | for key in expect.keys(): |
| 145 | expect_val = expect[key] |
Georg Brandl | ab91fde | 2009-08-13 08:51:18 +0000 | [diff] [blame] | 146 | self.assertTrue(key in fs) |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 147 | if len(expect_val) > 1: |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 148 | self.assertEqual(fs.getvalue(key), expect_val) |
| 149 | else: |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 150 | self.assertEqual(fs.getvalue(key), expect_val[0]) |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 151 | |
| 152 | def test_log(self): |
| 153 | cgi.log("Testing") |
| 154 | |
| 155 | cgi.logfp = StringIO() |
| 156 | cgi.initlog("%s", "Testing initlog 1") |
| 157 | cgi.log("%s", "Testing log 2") |
| 158 | self.assertEqual(cgi.logfp.getvalue(), "Testing initlog 1\nTesting log 2\n") |
| 159 | if os.path.exists("/dev/null"): |
| 160 | cgi.logfp = None |
| 161 | cgi.logfile = "/dev/null" |
| 162 | cgi.initlog("%s", "Testing log 3") |
| 163 | cgi.log("Testing log 4") |
| 164 | |
| 165 | def test_fieldstorage_readline(self): |
| 166 | # FieldStorage uses readline, which has the capacity to read all |
| 167 | # contents of the input file into memory; we use readline's size argument |
| 168 | # to prevent that for files that do not contain any newlines in |
| 169 | # non-GET/HEAD requests |
| 170 | class TestReadlineFile: |
| 171 | def __init__(self, file): |
| 172 | self.file = file |
| 173 | self.numcalls = 0 |
| 174 | |
| 175 | def readline(self, size=None): |
| 176 | self.numcalls += 1 |
| 177 | if size: |
| 178 | return self.file.readline(size) |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 179 | else: |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 180 | return self.file.readline() |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 181 | |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 182 | def __getattr__(self, name): |
| 183 | file = self.__dict__['file'] |
| 184 | a = getattr(file, name) |
| 185 | if not isinstance(a, int): |
| 186 | setattr(self, name, a) |
| 187 | return a |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 188 | |
Guido van Rossum | a1a6852 | 2007-08-28 03:11:34 +0000 | [diff] [blame] | 189 | f = TestReadlineFile(tempfile.TemporaryFile("w+")) |
| 190 | f.write('x' * 256 * 1024) |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 191 | f.seek(0) |
| 192 | env = {'REQUEST_METHOD':'PUT'} |
| 193 | fs = cgi.FieldStorage(fp=f, environ=env) |
| 194 | # if we're not chunking properly, readline is only called twice |
| 195 | # (by read_binary); if we are chunking properly, it will be called 5 times |
| 196 | # as long as the chunksize is 1 << 16. |
Georg Brandl | ab91fde | 2009-08-13 08:51:18 +0000 | [diff] [blame] | 197 | self.assertTrue(f.numcalls > 2) |
Jeremy Hylton | d9827c4 | 2000-08-03 22:11:43 +0000 | [diff] [blame] | 198 | |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 199 | def test_fieldstorage_multipart(self): |
| 200 | #Test basic FieldStorage multipart parsing |
| 201 | env = {'REQUEST_METHOD':'POST', 'CONTENT_TYPE':'multipart/form-data; boundary=---------------------------721837373350705526688164684', 'CONTENT_LENGTH':'558'} |
| 202 | postdata = """-----------------------------721837373350705526688164684 |
Thomas Wouters | 00ee7ba | 2006-08-21 19:07:27 +0000 | [diff] [blame] | 203 | Content-Disposition: form-data; name="id" |
| 204 | |
| 205 | 1234 |
| 206 | -----------------------------721837373350705526688164684 |
| 207 | Content-Disposition: form-data; name="title" |
| 208 | |
| 209 | |
| 210 | -----------------------------721837373350705526688164684 |
| 211 | Content-Disposition: form-data; name="file"; filename="test.txt" |
| 212 | Content-Type: text/plain |
| 213 | |
| 214 | Testing 123. |
| 215 | |
| 216 | -----------------------------721837373350705526688164684 |
| 217 | Content-Disposition: form-data; name="submit" |
| 218 | |
| 219 | Add\x20 |
| 220 | -----------------------------721837373350705526688164684-- |
| 221 | """ |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 222 | fs = cgi.FieldStorage(fp=StringIO(postdata), environ=env) |
| 223 | self.assertEquals(len(fs.list), 4) |
| 224 | expect = [{'name':'id', 'filename':None, 'value':'1234'}, |
| 225 | {'name':'title', 'filename':None, 'value':''}, |
Barry Warsaw | 596097e | 2008-06-12 02:38:51 +0000 | [diff] [blame] | 226 | {'name':'file', 'filename':'test.txt', 'value':'Testing 123.'}, |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 227 | {'name':'submit', 'filename':None, 'value':' Add '}] |
| 228 | for x in range(len(fs.list)): |
| 229 | for k, exp in expect[x].items(): |
| 230 | got = getattr(fs.list[x], k) |
| 231 | self.assertEquals(got, exp) |
Thomas Wouters | 00ee7ba | 2006-08-21 19:07:27 +0000 | [diff] [blame] | 232 | |
Benjamin Peterson | dcf97b9 | 2008-07-02 17:30:14 +0000 | [diff] [blame] | 233 | _qs_result = { |
| 234 | 'key1': 'value1', |
| 235 | 'key2': ['value2x', 'value2y'], |
| 236 | 'key3': 'value3', |
| 237 | 'key4': 'value4' |
| 238 | } |
| 239 | def testQSAndUrlEncode(self): |
| 240 | data = "key2=value2x&key3=value3&key4=value4" |
| 241 | environ = { |
| 242 | 'CONTENT_LENGTH': str(len(data)), |
| 243 | 'CONTENT_TYPE': 'application/x-www-form-urlencoded', |
| 244 | 'QUERY_STRING': 'key1=value1&key2=value2y', |
| 245 | 'REQUEST_METHOD': 'POST', |
| 246 | } |
| 247 | v = gen_result(data, environ) |
| 248 | self.assertEqual(self._qs_result, v) |
| 249 | |
| 250 | def testQSAndFormData(self): |
| 251 | data = """ |
| 252 | ---123 |
| 253 | Content-Disposition: form-data; name="key2" |
| 254 | |
| 255 | value2y |
| 256 | ---123 |
| 257 | Content-Disposition: form-data; name="key3" |
| 258 | |
| 259 | value3 |
| 260 | ---123 |
| 261 | Content-Disposition: form-data; name="key4" |
| 262 | |
| 263 | value4 |
| 264 | ---123-- |
| 265 | """ |
| 266 | environ = { |
| 267 | 'CONTENT_LENGTH': str(len(data)), |
| 268 | 'CONTENT_TYPE': 'multipart/form-data; boundary=-123', |
| 269 | 'QUERY_STRING': 'key1=value1&key2=value2x', |
| 270 | 'REQUEST_METHOD': 'POST', |
| 271 | } |
| 272 | v = gen_result(data, environ) |
| 273 | self.assertEqual(self._qs_result, v) |
| 274 | |
| 275 | def testQSAndFormDataFile(self): |
| 276 | data = """ |
| 277 | ---123 |
| 278 | Content-Disposition: form-data; name="key2" |
| 279 | |
| 280 | value2y |
| 281 | ---123 |
| 282 | Content-Disposition: form-data; name="key3" |
| 283 | |
| 284 | value3 |
| 285 | ---123 |
| 286 | Content-Disposition: form-data; name="key4" |
| 287 | |
| 288 | value4 |
| 289 | ---123 |
| 290 | Content-Disposition: form-data; name="upload"; filename="fake.txt" |
| 291 | Content-Type: text/plain |
| 292 | |
| 293 | this is the content of the fake file |
| 294 | |
| 295 | ---123-- |
| 296 | """ |
| 297 | environ = { |
| 298 | 'CONTENT_LENGTH': str(len(data)), |
| 299 | 'CONTENT_TYPE': 'multipart/form-data; boundary=-123', |
| 300 | 'QUERY_STRING': 'key1=value1&key2=value2x', |
| 301 | 'REQUEST_METHOD': 'POST', |
| 302 | } |
| 303 | result = self._qs_result.copy() |
| 304 | result.update({ |
| 305 | 'upload': 'this is the content of the fake file' |
| 306 | }) |
| 307 | v = gen_result(data, environ) |
| 308 | self.assertEqual(result, v) |
| 309 | |
Facundo Batista | bd18fd6 | 2008-09-08 00:23:29 +0000 | [diff] [blame] | 310 | def test_deprecated_parse_qs(self): |
| 311 | # this func is moved to urlparse, this is just a sanity check |
Facundo Batista | a27244b | 2008-09-09 02:43:19 +0000 | [diff] [blame] | 312 | with catch_warnings(): |
| 313 | filterwarnings('ignore', |
| 314 | 'cgi.parse_qs is deprecated, use urllib.parse.parse_qs instead', |
| 315 | DeprecationWarning) |
| 316 | self.assertEqual({'a': ['A1'], 'B': ['B3'], 'b': ['B2']}, |
| 317 | cgi.parse_qs('a=A1&b=B2&B=B3')) |
Facundo Batista | bd18fd6 | 2008-09-08 00:23:29 +0000 | [diff] [blame] | 318 | |
| 319 | def test_deprecated_parse_qsl(self): |
| 320 | # this func is moved to urlparse, this is just a sanity check |
Facundo Batista | a27244b | 2008-09-09 02:43:19 +0000 | [diff] [blame] | 321 | with catch_warnings(): |
| 322 | filterwarnings('ignore', |
| 323 | 'cgi.parse_qsl is deprecated, use urllib.parse.parse_qsl instead', |
| 324 | DeprecationWarning) |
| 325 | self.assertEqual([('a', 'A1'), ('b', 'B2'), ('B', 'B3')], |
| 326 | cgi.parse_qsl('a=A1&b=B2&B=B3')) |
Facundo Batista | bd18fd6 | 2008-09-08 00:23:29 +0000 | [diff] [blame] | 327 | |
Fred Drake | 9a0a65b | 2008-12-04 19:24:50 +0000 | [diff] [blame] | 328 | def test_parse_header(self): |
| 329 | self.assertEqual( |
| 330 | cgi.parse_header("text/plain"), |
| 331 | ("text/plain", {})) |
| 332 | self.assertEqual( |
| 333 | cgi.parse_header("text/vnd.just.made.this.up ; "), |
| 334 | ("text/vnd.just.made.this.up", {})) |
| 335 | self.assertEqual( |
| 336 | cgi.parse_header("text/plain;charset=us-ascii"), |
| 337 | ("text/plain", {"charset": "us-ascii"})) |
| 338 | self.assertEqual( |
| 339 | cgi.parse_header('text/plain ; charset="us-ascii"'), |
| 340 | ("text/plain", {"charset": "us-ascii"})) |
| 341 | self.assertEqual( |
| 342 | cgi.parse_header('text/plain ; charset="us-ascii"; another=opt'), |
| 343 | ("text/plain", {"charset": "us-ascii", "another": "opt"})) |
| 344 | self.assertEqual( |
| 345 | cgi.parse_header('attachment; filename="silly.txt"'), |
| 346 | ("attachment", {"filename": "silly.txt"})) |
| 347 | self.assertEqual( |
| 348 | cgi.parse_header('attachment; filename="strange;name"'), |
| 349 | ("attachment", {"filename": "strange;name"})) |
| 350 | self.assertEqual( |
| 351 | cgi.parse_header('attachment; filename="strange;name";size=123;'), |
| 352 | ("attachment", {"filename": "strange;name", "size": "123"})) |
| 353 | |
| 354 | |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 355 | def test_main(): |
| 356 | run_unittest(CgiTests) |
| 357 | |
| 358 | if __name__ == '__main__': |
| 359 | test_main() |