(data)
| 10 | |
| 11 | |
| 12 | def test_one_input(data): |
| 13 | reader = StreamReader() |
| 14 | reader.feed_data(data) |
| 15 | reader.feed_eof() |
| 16 | |
| 17 | parser = Request.parse( |
| 18 | reader.read_line, |
| 19 | ) |
| 20 | |
| 21 | try: |
| 22 | next(parser) |
| 23 | except StopIteration as exc: |
| 24 | assert isinstance(exc.value, Request) |
| 25 | return # input accepted |
| 26 | except ( |
| 27 | EOFError, # connection is closed without a full HTTP request |
| 28 | SecurityError, # request exceeds a security limit |
| 29 | ValueError, # request isn't well formatted |
| 30 | ): |
| 31 | return # input rejected with a documented exception |
| 32 | |
| 33 | raise RuntimeError("parsing didn't complete") |
| 34 | |
| 35 | |
| 36 | def main(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…