def test_proxy_get():
 client = Client()
 client.login(username='test', password='test')
 (httpd, finish) = run_test_server()
 try:
  finish_conf = proxy.conf.WHITELIST.set_for_testing('127\\.0\\.0\\.1:\\d*')
  try:
   response_get = client.get(('/proxy/127.0.0.1/%s/' % httpd.server_port), dict(foo='bar'))
  finally:
   finish_conf()
  assert_true(('Hello there' in response_get.content))
  assert_true(('You requested: /?foo=bar.' in response_get.content))
  assert_true((('/proxy/127.0.0.1/%s/foo.jpg' % httpd.server_port) in response_get.content))
  assert_true((('/proxy/127.0.0.1/%s/baz?with=parameter' % httpd.server_port) in response_get.content))
 finally:
  finish()

def test_proxy_get ( ) : client = Client ( ) client . login ( username = 'test' , password = 'test' ) ( httpd , finish ) = run_test_server ( ) try : finish_conf = proxy . conf . WHITELIST . set_for_testing ( '127\\.0\\.0\\.1:\\d*' ) try : response_get = client . get ( ( '/proxy/127.0.0.1/%s/' % httpd . server_port ) , dict ( foo = 'bar' ) ) finally : finish_conf ( ) assert_true ( ( 'Hello there' in response_get . content ) ) assert_true ( ( 'You requested: /?foo=bar.' in response_get . content ) ) assert_true ( ( ( '/proxy/127.0.0.1/%s/foo.jpg' % httpd . server_port ) in response_get . content ) ) assert_true ( ( ( '/proxy/127.0.0.1/%s/baz?with=parameter' % httpd . server_port ) in response_get . content ) ) finally : finish ( )
proxying test .