comparison tests/test.py @ 64:bb8d993376aa

* convenience methods for multipart form * include this in test globals
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 01 Mar 2012 18:15:34 -0800
parents af1476a936fc
children 83327bc715be
comparison
equal deleted inserted replaced
63:af1476a936fc 64:bb8d993376aa
7 # XXX could use http://blog.ianbicking.org/2010/04/02/webtest-http-testing/ 7 # XXX could use http://blog.ianbicking.org/2010/04/02/webtest-http-testing/
8 # vs paste.fixture.TestApp: 8 # vs paste.fixture.TestApp:
9 # http://pythonpaste.org/testing-applications.html 9 # http://pythonpaste.org/testing-applications.html
10 10
11 import doctest 11 import doctest
12 import multipart
12 import os 13 import os
13 import shutil 14 import shutil
14 import sys 15 import sys
15 import tempfile 16 import tempfile
16 import testserver 17 import testserver
33 34
34 # doctest arguments 35 # doctest arguments
35 directory = os.path.dirname(os.path.abspath(__file__)) 36 directory = os.path.dirname(os.path.abspath(__file__))
36 extraglobs = {'here': directory, 37 extraglobs = {'here': directory,
37 'create_virtualenv': create_virtualenv, 38 'create_virtualenv': create_virtualenv,
38 'testserver': testserver.TestWSGIServer } 39 'testserver': testserver.TestWSGIServer,
40 'MultiPartForm': multipart.MultiPartForm
41 }
39 doctest_args = dict(extraglobs=extraglobs, raise_on_error=raise_on_error) 42 doctest_args = dict(extraglobs=extraglobs, raise_on_error=raise_on_error)
40 if report_first: 43 if report_first:
41 doctest_args['optionflags'] = doctest.REPORT_ONLY_FIRST_FAILURE 44 doctest_args['optionflags'] = doctest.REPORT_ONLY_FIRST_FAILURE
42 45
43 # gather tests 46 # gather tests