Outgoing data for ``connection`` contains the given frame. ``frame`` may be ``None`` if no frame is expected. When ``eof`` is ``True``, the end of the stream is also expected.
(self, connection, frame, eof=False)
| 29 | |
| 30 | class ProtocolTestCase(FramesTestCase): |
| 31 | def assertFrameSent(self, connection, frame, eof=False): |
| 32 | """ |
| 33 | Outgoing data for ``connection`` contains the given frame. |
| 34 | |
| 35 | ``frame`` may be ``None`` if no frame is expected. |
| 36 | |
| 37 | When ``eof`` is ``True``, the end of the stream is also expected. |
| 38 | |
| 39 | """ |
| 40 | frames_sent = [ |
| 41 | ( |
| 42 | None |
| 43 | if write is SEND_EOF |
| 44 | else self.parse( |
| 45 | write, |
| 46 | mask=connection.side is CLIENT, |
| 47 | extensions=connection.extensions, |
| 48 | ) |
| 49 | ) |
| 50 | for write in connection.data_to_send() |
| 51 | ] |
| 52 | frames_expected = [] if frame is None else [frame] |
| 53 | if eof: |
| 54 | frames_expected += [None] |
| 55 | self.assertEqual(frames_sent, frames_expected) |
| 56 | |
| 57 | def assertFrameReceived(self, connection, frame): |
| 58 | """ |
no test coverage detected