Exemple #1
0
    def test_finalise_handshake(self, handshake_response: Mock,
                                transport: Mock) -> None:
        server = WebSocketServer()
        server.transport = transport

        server.finalise_handshake(b"12345")

        assert server.initialised is True
        transport.write.assert_called_once_with(handshake_response)
Exemple #2
0
    def test_finalise_handshake_when_transport_is_none(self) -> None:
        server = WebSocketServer()

        server.finalise_handshake(b"12345")

        assert server.initialised is False