r""" Check the command `output` for an exact full sequence of `tokens`. >>> out = 'GET / HTTP/1.1\r\nAAA:BBB\r\n\r\nCCC\n\n' >>> assert_output_matches(out, [Expect.REQUEST_HEADERS, Expect.BODY, Expect.SEPARATOR])
(output: str, tokens: Iterable[Expect])
| 19 | |
| 20 | |
| 21 | def assert_output_matches(output: str, tokens: Iterable[Expect]): |
| 22 | r""" |
| 23 | Check the command `output` for an exact full sequence of `tokens`. |
| 24 | |
| 25 | >>> out = 'GET / HTTP/1.1\r\nAAA:BBB\r\n\r\nCCC\n\n' |
| 26 | >>> assert_output_matches(out, [Expect.REQUEST_HEADERS, Expect.BODY, Expect.SEPARATOR]) |
| 27 | |
| 28 | """ |
| 29 | # TODO: auto-remove ansi colors to allow for testing of colorized output as well. |
| 30 | expect_tokens(tokens=tokens, s=output) |
| 31 | |
| 32 | |
| 33 | def assert_output_does_not_match(output: str, tokens: Iterable[Expect]): |