Send one fuzz command. APIError -> server rejected the input cleanly (pass). ConnectionError -> server defensively dropped the client (pass); reconnect. TimeoutError -> not caught here; it means a hang and must fail the test.
(api_client, command, params)
| 80 | |
| 81 | |
| 82 | def _fuzz_send(api_client, command, params): |
| 83 | """Send one fuzz command. |
| 84 | |
| 85 | APIError -> server rejected the input cleanly (pass). |
| 86 | ConnectionError -> server defensively dropped the client (pass); reconnect. |
| 87 | TimeoutError -> not caught here; it means a hang and must fail the test. |
| 88 | """ |
| 89 | try: |
| 90 | api_client.command(command, params) |
| 91 | except APIError: |
| 92 | pass |
| 93 | except ConnectionError: |
| 94 | api_client.disconnect() |
| 95 | api_client.connect() |
| 96 | |
| 97 | |
| 98 | def _assert_server_alive(api_client): |
no test coverage detected