Example #1
0
 def test_proxy_get_h1_h1(self):
   responses = [
     http_get(url='https://localhost:8443/', headers={"x-echo": "echo"}, h2=False),
     http_get(url='https://localhost:8443/', headers={"x-echo": "echo"}, h2=False),
   ]
   for response in responses:
     self.check_response(response, 'GET')
Example #2
0
 def test_backend_server_get_h2_works(self):
   responses = [
     http_get(url='https://localhost:{}/'.format(back_end.port), headers={"x-echo": "echo"}, h2=True),
     http_get(url='https://localhost:{}/'.format(back_end.port), headers={"x-echo": "echo"}, h2=True),
   ]
   for response in responses:
     self.check_response(response, 'GET')
Example #3
0
 def test_backend_server_works(self):
     self.setup_back(h2=False)
     for each in self.back_ends:
         response = http_get(url='https://localhost:{}/'.format(each.port))
         self.assertEqual('backend1', response.headers['header-tag'])
         self.assertEqual('Release the Kraken', response.body)
         self.assertEqual(200, response.status)
Example #4
0
 def test_proxy_get_h1_h1(self):
     self.setup_front(h2=False)
     self.setup_back(h2=False)
     responses = (
         http_get(url='https://localhost:8443/'),
         # http_get(url='https://localhost:8443/'),  # todo: (WK) fails Http2To1ProxyRequestQueue
     )
     for response in responses:
         self.assertEqual('backend1', response.headers['header-tag'])
         self.assertEqual('Release the Kraken', response.body)
         self.assertEqual(200, response.status)
Example #5
0
 def test_backend_server_get_h1_works(self):
   response = http_get(url='https://localhost:{}/'.format(back_end.port), headers={"x-echo": "echo"}, h2=False)
   self.check_response(response, 'GET')
Example #6
0
 def test_get_foo(self):
     response = http_get(url='http://localhost:8181/foo')
     self.assertEqual("hello path GET foo", response.body)
     self.assertEqual("there", response.headers['hi'])
     self.assertEqual(200, response.status)