Changeset 5192

Show
Ignore:
Timestamp:
08/21/08 20:47:59 (5 months ago)
Author:
carndt
Message:

Minor docstring fixes in url() tests and test method re-ordering.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/turbogears/tests/test_controllers.py

    r5191 r5192  
    601601        cherrypy.root.subthing.subsubthing = SubApp() 
    602602 
     603    def tearDown(self): 
     604        config.update({"server.webpath": ""}) 
     605        startup.startTurboGears() 
     606 
    603607    def test_basic_urls(self): 
    604608        testutil.create_request("/") 
     
    679683 
    680684    def test_existing_query_string(self): 
    681         """url() can handle URl with existing query string.""" 
     685        """url() can handle URL with existing query string""" 
    682686        testutil.create_request("/") 
    683687        test_url = url('/foo', {'first': 1}) 
    684688        assert url(test_url, {'second': 2}) == '/foo?first=1&second=2' 
    685689 
    686     def tearDown(self): 
    687         config.update({"server.webpath": ""}) 
    688         startup.startTurboGears() 
    689  
     690    def test_url_kwargs_overwrite_tgparams(self): 
     691        """Keys in tgparams in call to url() overwrite kw args""" 
     692        params = {'spamm': 'eggs'} 
     693        assert 'spamm=ham' in url('/foo', params, spamm='ham') 
     694 
     695    def test_url_doesnt_change_tgparams(self): 
     696        """url() does not change the dict passed as second arg""" 
     697        params = {'spamm': 'eggs'} 
     698        assert 'foo' in url('/foo', params, spamm='ham') 
     699        assert params['spamm'] == 'eggs' 
    690700 
    691701def test_index_trailing_slash(): 
     
    711721    assert "template:bar" in output 
    712722    assert "fragment:boo" in output 
    713  
    714 def test_url_kwargs_overwrite_tgparams(): 
    715     """Check keys in tgparams in call to url overwrite kw args""" 
    716     params = {'spamm': 'eggs'} 
    717     assert 'spamm=ham' in url('/foo', params, spamm='ham') 
    718  
    719 def test_url_doesnt_change_tgparams(): 
    720     """Test that url() does not change the dict passed as second arg""" 
    721     params = {'spamm': 'eggs'} 
    722     assert 'foo' in url('/foo', params, spamm='ham') 
    723     assert params['spamm'] == 'eggs'