def test_set(self): # Test that setInWSGIEnvironment() can set keys in the WSGI # environment. data = StringIO.StringIO('foo') env = {} request = LaunchpadBrowserRequest(data, env) request.setInWSGIEnvironment('key', 'value') self.assertEqual(request._orig_env['key'], 'value')
def test_set(self): # Test that setInWSGIEnvironment() can set keys in the WSGI # environment. data = StringIO.StringIO('foo') env = {} request = LaunchpadBrowserRequest(data, env) request.setInWSGIEnvironment('key', 'value') self.assertEqual(request._orig_env['key'], 'value')
def test_set_twice(self): # Test that setInWSGIEnvironment() can change the value of # keys in the WSGI environment that it had previously set. data = StringIO.StringIO('foo') env = {} request = LaunchpadBrowserRequest(data, env) request.setInWSGIEnvironment('key', 'first value') request.setInWSGIEnvironment('key', 'second value') self.assertEqual(request._orig_env['key'], 'second value')
def test_set_twice(self): # Test that setInWSGIEnvironment() can change the value of # keys in the WSGI environment that it had previously set. data = StringIO.StringIO('foo') env = {} request = LaunchpadBrowserRequest(data, env) request.setInWSGIEnvironment('key', 'first value') request.setInWSGIEnvironment('key', 'second value') self.assertEqual(request._orig_env['key'], 'second value')
def test_set_after_retry(self): # Test that setInWSGIEnvironment() a key in the environment # can be set twice over a request retry. data = StringIO.StringIO('foo') env = {} request = LaunchpadBrowserRequest(data, env) request.setInWSGIEnvironment('key', 'first value') new_request = request.retry() new_request.setInWSGIEnvironment('key', 'second value') self.assertEqual(new_request._orig_env['key'], 'second value')
def test_set_after_retry(self): # Test that setInWSGIEnvironment() a key in the environment # can be set twice over a request retry. data = StringIO.StringIO('foo') env = {} request = LaunchpadBrowserRequest(data, env) request.setInWSGIEnvironment('key', 'first value') new_request = request.retry() new_request.setInWSGIEnvironment('key', 'second value') self.assertEqual(new_request._orig_env['key'], 'second value')