(websocket: WebSocketClientProtocol, url: str, count_send: int)
| 154 | |
| 155 | # Every http request has two log lines sent |
| 156 | async def generate_and_validate_http_events(websocket: WebSocketClientProtocol, url: str, count_send: int): |
| 157 | for i in range(count_send): |
| 158 | send_request(url) |
| 159 | # There are typically always two log lines for http requests (request and response) |
| 160 | count = 0 |
| 161 | while True: |
| 162 | try: |
| 163 | req_line = await asyncio.wait_for(websocket.recv(), 2) |
| 164 | log_line = json.loads(req_line) |
| 165 | assert log_line["type"] == "logs" |
| 166 | assert log_line["logs"][0]["event"] == "http" |
| 167 | count += 1 |
| 168 | except asyncio.TimeoutError: |
| 169 | # ignore timeout from waiting for recv |
| 170 | break |
| 171 | return count |
| 172 | |
| 173 | # Every http request has two log lines sent |
| 174 | async def generate_and_validate_no_log_event(websocket: WebSocketClientProtocol, url: str): |
no test coverage detected
searching dependent graphs…