MCPcopy
hub / github.com/benoitc/gunicorn / test_combined

Function test_combined

examples/http2_features/test_http2.py:203–223  ·  view source on GitHub ↗

Test combined priority and trailers.

(host, port)

Source from the content-addressed store, hash-verified

201
202
203def test_combined(host, port):
204 """Test combined priority and trailers."""
205 print("\n=== Testing Combined Features ===")
206
207 try:
208 sock, h2_conn = create_h2_connection(host, port)
209
210 response = h2_request(sock, h2_conn, 1, 'GET', '/combined', f'{host}:{port}')
211 print(f"Status: {response['status']}")
212
213 data = json.loads(response['body'].decode())
214 print(f"Response: {json.dumps(data, indent=2)}")
215
216 if response['trailers']:
217 print(f"Trailers: {response['trailers']}")
218
219 sock.close()
220 return response['status'] == 200
221 except Exception as e:
222 print(f"ERROR: {e}")
223 return False
224
225
226def test_multiple_streams(host, port):

Callers 1

mainFunction · 0.85

Calls 4

create_h2_connectionFunction · 0.85
h2_requestFunction · 0.85
decodeMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected