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

Function test_priority

examples/http2_features/test_http2.py:154–175  ·  view source on GitHub ↗

Test stream priority endpoint.

(host, port)

Source from the content-addressed store, hash-verified

152
153
154def test_priority(host, port):
155 """Test stream priority endpoint."""
156 print("\n=== Testing Stream Priority ===")
157
158 try:
159 sock, h2_conn = create_h2_connection(host, port)
160
161 response = h2_request(sock, h2_conn, 1, 'GET', '/priority', f'{host}:{port}')
162 print(f"Status: {response['status']}")
163
164 data = json.loads(response['body'].decode())
165 print(f"Priority info: {data.get('priority')}")
166
167 if data.get("priority"):
168 print(f" Weight: {data['priority']['weight']}")
169 print(f" Depends on: {data['priority']['depends_on']}")
170
171 sock.close()
172 return response['status'] == 200 and data.get("priority") is not None
173 except Exception as e:
174 print(f"ERROR: {e}")
175 return False
176
177
178def test_trailers(host, port):

Callers 1

mainFunction · 0.85

Calls 5

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

Tested by

no test coverage detected