(ws)
| 16 | |
| 17 | |
| 18 | def handler(ws): |
| 19 | path = urllib.parse.urlparse(ws.request.path).path |
| 20 | if path == "/": |
| 21 | # The default path is an eval shell. |
| 22 | for expr in ws: |
| 23 | value = eval(expr) |
| 24 | ws.send(str(value)) |
| 25 | elif path == "/crash": |
| 26 | raise RuntimeError |
| 27 | elif path == "/no-op": |
| 28 | pass |
| 29 | else: |
| 30 | raise AssertionError(f"unexpected path: {path}") |
| 31 | |
| 32 | |
| 33 | class EvalShellMixin: |
no test coverage detected
searching dependent graphs…