(self)
| 25 | |
| 26 | class TestWebSocketMessage: |
| 27 | def test_basic(self): |
| 28 | m = websocket.WebSocketMessage(Opcode.TEXT, True, b"foo") |
| 29 | m.set_state(m.get_state()) |
| 30 | assert m.content == b"foo" |
| 31 | assert repr(m) == "'foo'" |
| 32 | m.type = Opcode.BINARY |
| 33 | assert repr(m) == "b'foo'" |
| 34 | |
| 35 | assert not m.dropped |
| 36 | m.drop() |
| 37 | assert m.dropped |
| 38 | |
| 39 | def test_text(self): |
| 40 | txt = websocket.WebSocketMessage(Opcode.TEXT, True, b"foo") |