(caplog)
| 164 | |
| 165 | |
| 166 | async def test_inject_fail(caplog) -> None: |
| 167 | ps = Proxyserver() |
| 168 | ps.inject_websocket(tflow.tflow(), True, b"test") |
| 169 | assert "Cannot inject WebSocket messages into non-WebSocket flows." in caplog.text |
| 170 | ps.inject_tcp(tflow.tflow(), True, b"test") |
| 171 | assert "Cannot inject TCP messages into non-TCP flows." in caplog.text |
| 172 | ps.inject_tcp(tflow.ttcpflow(), True, b"test") |
| 173 | assert "Flow is not from a live connection." in caplog.text |
| 174 | |
| 175 | ps.inject_udp(tflow.tflow(), True, b"test") |
| 176 | assert "Cannot inject UDP messages into non-UDP flows." in caplog.text |
| 177 | ps.inject_udp(tflow.tudpflow(), True, b"test") |
| 178 | assert "Flow is not from a live connection." in caplog.text |
| 179 | |
| 180 | ps.inject_websocket(tflow.twebsocketflow(), True, b"test") |
| 181 | assert "Flow is not from a live connection." in caplog.text |
| 182 | ps.inject_websocket(tflow.ttcpflow(), True, b"test") |
| 183 | assert "Cannot inject WebSocket messages into non-WebSocket flows" in caplog.text |
| 184 | |
| 185 | # str must not reach inject_event (issue #5808). |
| 186 | ps.inject_websocket("@focus", True, b"test") # type: ignore[arg-type] |
| 187 | |
| 188 | |
| 189 | async def test_warn_no_nextlayer(caplog): |
nothing calls this directly
no test coverage detected
searching dependent graphs…