Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1114

Show
Ignore:
Timestamp:
06/01/06 12:05:33
Author:
fumanchu
Message:

Removed "filter" from lots of places, including renaming of tests.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/wsgiapp.py

    r1096 r1114  
    5757    environ['PATH_INFO'] = cherrypy.request.path_info 
    5858     
    59     # update the environ with the dict passed to the filter's 
    60     # constructor 
    6159    if env: 
    6260        environ.update(env) 
  • trunk/cherrypy/test/test.py

    r1099 r1114  
    289289     
    290290    testList = [ 
    291         'test_baseurl_filter', 
    292         'test_cache_filter', 
    293         'test_combinedfilters', 
     291        'test_baseurl', 
     292        'test_caching', 
    294293        'test_config', 
    295294        'test_core', 
    296         'test_custom_filters', 
    297         'test_decodingencoding_filter', 
    298         'test_gzip_filter', 
     295        'test_tools', 
     296        'test_decodingencoding', 
     297        'test_gzip', 
    299298        'test_objectmapping', 
    300         'test_response_headers_filter', 
    301         'test_static_filter', 
     299        'test_response_headers', 
     300        'test_static', 
    302301        'test_tutorials', 
    303         'test_virtualhost_filter', 
    304         'test_session_filter', 
    305         'test_sessionauthenticate_filter', 
     302        'test_virtualhost', 
     303        'test_session', 
     304        'test_sessionauthenticate', 
    306305##        'test_states', 
    307         'test_xmlrpc_filter', 
    308         'test_wsgiapp_filter', 
     306        'test_xmlrpc', 
     307        'test_wsgiapp', 
    309308    ] 
    310309    CommandLineParser(testList).run() 
  • trunk/cherrypy/test/test_baseurl.py

    r1113 r1114  
    2222import helper 
    2323 
    24 class BaseUrlFilterTest(helper.CPWebCase): 
     24class BaseUrlTest(helper.CPWebCase): 
    2525     
    26     def testBaseUrlFilter(self): 
     26    def testBaseUrl(self): 
    2727        self.getPage("/") 
    2828        self.assertHeader('Location', 
  • trunk/cherrypy/test/test_caching.py

    r1113 r1114  
    2929import helper 
    3030 
    31 class CacheFilterTest(helper.CPWebCase): 
     31class CacheTest(helper.CPWebCase): 
    3232     
    3333    def testCaching(self): 
  • trunk/cherrypy/test/test_decodingencoding.py

    r1113 r1114  
    3232 
    3333 
    34 class DecodingEncodingFilterTest(helper.CPWebCase): 
     34class DecodingEncodingTest(helper.CPWebCase): 
    3535     
    36     def testDecodingEncodingFilter(self): 
     36    def testDecodingEncoding(self): 
    3737        europoundUtf8 = europoundUnicode.encode('utf-8') 
    3838        self.getPage('/?param=%s' % europoundUtf8) 
  • trunk/cherrypy/test/test_gzip.py

    r1113 r1114  
    4040europoundUtf8 = u'\x80\xa3'.encode('utf-8') 
    4141 
    42 class GzipFilterTest(helper.CPWebCase): 
     42class GzipTest(helper.CPWebCase): 
    4343     
    44     def testGzipFilter(self): 
     44    def testGzip(self): 
    4545        zbuf = StringIO.StringIO() 
    4646        zfile = gzip.GzipFile(mode='wb', fileobj=zbuf, compresslevel=9) 
  • trunk/cherrypy/test/test_response_headers.py

    r1113 r1114  
    3434import helper 
    3535 
    36 class ResponseHeadersFilterTest(helper.CPWebCase): 
     36class ResponseHeadersTest(helper.CPWebCase): 
    3737 
    3838    def testResponseHeadersDecorator(self): 
     
    4141        self.assertHeader('Content-Type', 'text/plain') 
    4242 
    43     def testResponseHeadersFilter(self): 
     43    def testResponseHeaders(self): 
    4444        self.getPage('/other') 
    4545        self.assertHeader("Content-Language", "fr") 
    46         # Since 'force' is False, the filter should only change headers 
     46        # Since 'force' is False, the tool should only change headers 
    4747        # that have not been set yet. 
    4848        # Content-Type should have been set when the response object 
  • trunk/cherrypy/test/test_session.py

    r1113 r1114  
    3737import helper 
    3838 
    39 class SessionFilterTest(helper.CPWebCase): 
     39class SessionTest(helper.CPWebCase): 
    4040     
    41     def testSessionFilter(self): 
     41    def testSession(self): 
    4242        self.getPage('/testStr') 
    4343        self.assertBody('1') 
  • trunk/cherrypy/test/test_sessionauthenticate.py

    r1113 r1114  
    3131import helper 
    3232 
    33 class SessionAuthenticateFilterTest(helper.CPWebCase): 
     33class SessionAuthenticateTest(helper.CPWebCase): 
    3434     
    35     def testSessionAuthenticateFilter(self): 
     35    def testSessionAuthenticate(self): 
    3636        # request a page and check for login form 
    3737        self.getPage('/') 
  • trunk/cherrypy/test/test_static.py

    r1113 r1114  
    5959import helper 
    6060 
    61 class StaticFilterTest(helper.CPWebCase): 
     61class StaticTest(helper.CPWebCase): 
    6262     
    63     def testStaticFilter(self): 
     63    def testStatic(self): 
    6464        self.getPage("/static/index.html") 
    6565        self.assertStatus('200 OK') 
     
    6767        self.assertBody('Hello, world\r\n') 
    6868         
    69         # Using a static_filter.root value in a subdir... 
     69        # Using a staticdir.root value in a subdir... 
    7070        self.getPage("/docroot/index.html") 
    7171        self.assertStatus('200 OK') 
     
    9898        self.assertBody('You want the Baron? You can have the Baron!') 
    9999         
    100         # Check a directory via "static_filter.index". 
     100        # Check a directory via "staticdir.index". 
    101101        self.getPage("/docroot/") 
    102102        self.assertStatus('200 OK') 
  • trunk/cherrypy/test/test_tools.py

    r1113 r1114  
    1 """Test the various means of instantiating and invoking filters.""" 
    2  
     1"""Test the various means of instantiating and invoking tools.""" 
     2 
     3import gzip, StringIO 
    34import types 
    45import test 
     
    89from cherrypy import tools 
    910 
     11 
     12europoundUnicode = u'\x80\xa3' 
    1013 
    1114def setup_server(): 
     
    6568            return "Howdy earth!" 
    6669        index.exposed = True 
     70         
     71        def euro(self): 
     72            yield u"Hello," 
     73            yield u"world" 
     74            yield europoundUnicode 
     75        euro.exposed = True 
     76     
    6777    root = Root() 
    6878     
     
    132142            'tools.numerify.map': "pie->3.14159" 
    133143        }, 
     144        # Combined tools 
     145        '/euro': { 
     146            'tools.gzip.on': True, 
     147            'tools.encode.on': True, 
     148        }, 
    134149    } 
    135150    cherrypy.tree.mount(root, conf=conf) 
     
    141156 
    142157 
    143 class FilterTests(helper.CPWebCase): 
     158class ToolTests(helper.CPWebCase): 
    144159     
    145160    def testDemo(self): 
     
    173188        self.assertErrorPage(401) 
    174189     
    175     def testGuaranteedFilters(self): 
    176         # The on_start_resource and on_end_request filter methods are all 
     190    def testGuaranteedHooks(self): 
     191        # The on_start_resource and on_end_request hooks are all 
    177192        # guaranteed to run, even if there are failures in other on_start 
    178         # or on_end methods. This is NOT true of the other filter methods. 
    179         # Here, we have set up a failure in NumerifyFilter.on_start_resource, 
     193        # or on_end methods. This is NOT true of the other hooks. 
     194        # Here, we have set up a failure in NumerifyTool.on_start_resource, 
    180195        # but because that failure is logged and passed over, the error 
    181196        # page we obtain in the user agent should be from before_finalize. 
     
    184199        self.assertInBody("AttributeError: 'Request' object has no " 
    185200                          "attribute 'numerify_map'") 
     201     
     202    def testCombinedTools(self): 
     203        expectedResult = (u"Hello,world" + europoundUnicode).encode('utf-8') 
     204        zbuf = StringIO.StringIO() 
     205        zfile = gzip.GzipFile(mode='wb', fileobj=zbuf, compresslevel=9) 
     206        zfile.write(expectedResult) 
     207        zfile.close() 
     208         
     209        self.getPage("/euro", headers=[("Accept-Encoding", "gzip")]) 
     210        self.assertInBody(zbuf.getvalue()[:3]) 
    186211 
    187212 
  • trunk/cherrypy/test/test_tutorials.py

    r1106 r1114  
    2626         
    2727        app.root.load_tut_module = load_tut_module 
    28         app.root.sessfilteron = sessfilteron 
     28        app.root.sessions = sessions 
    2929        app.root.traceback_setting = traceback_setting 
    3030    load_tut_module.exposed = True 
    3131     
    32     def sessfilteron(): 
    33         cherrypy.config.update({"session_filter.on": True}) 
    34     sessfilteron.exposed = True 
     32    def sessions(): 
     33        cherrypy.config.update({"tools.sessions.on": True}) 
     34    sessions.exposed = True 
    3535     
    3636    def traceback_setting(): 
     
    118118    def test07Sessions(self): 
    119119        self.getPage("/load_tut_module/tut07_sessions") 
    120         self.getPage("/sessfilteron") 
     120        self.getPage("/sessions") 
    121121         
    122122        self.getPage('/') 
  • trunk/cherrypy/test/test_virtualhost.py

    r1113 r1114  
    4848import helper 
    4949 
    50 class VirtualHostFilterTest(helper.CPWebCase): 
     50class VirtualHostTest(helper.CPWebCase): 
    5151     
    52     def testVirtualHostFilter(self): 
     52    def testVirtualHost(self): 
    5353        self.getPage("/", [('Host', 'www.mydom1.com')]) 
    5454        self.assertBody('Hello, world') 
  • trunk/cherrypy/test/test_wsgiapp.py

    r1113 r1114  
    4747 
    4848 
    49 class WSGIAppFilterTest(helper.CPWebCase): 
     49class WSGIAppTest(helper.CPWebCase): 
    5050     
    5151    wsgi_output = '''Hello, world! 
     
    5656        self.assertBody("I'm a regular CherryPy page handler!") 
    5757     
    58     def test_02_cp_filters(self): 
     58    def test_02_tools(self): 
    5959        self.getPage("/hosted/app0") 
    6060        self.assertHeader("Content-Type", "text/plain") 
  • trunk/cherrypy/test/test_xmlrpc.py

    r1113 r1114  
    6868import helper 
    6969 
    70 class XmlRpcFilterTest(helper.CPWebCase): 
    71     def testXmlRpcFilter(self): 
     70class XmlRpcTest(helper.CPWebCase): 
     71    def testXmlRpc(self): 
    7272         
    7373        # load the appropriate xmlrpc proxy 

Hosted by WebFaction

Log in as guest/cpguest to create tickets