Test stream priority endpoint.
(host, port)
| 152 | |
| 153 | |
| 154 | def 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 | |
| 178 | def test_trailers(host, port): |
no test coverage detected