Exemplo n.º 1
0
 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')
Exemplo n.º 2
0
 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')
Exemplo n.º 3
0
 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')
Exemplo n.º 4
0
 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')
Exemplo n.º 5
0
 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')
Exemplo n.º 6
0
 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')