Exemplo n.º 1
0
    def test_error(self):
        message = websocket.Message(
            socket=mock.sentinel.socket, payload={"type": "wibble"}
        )

        with mock.patch.object(websocket.Message, "reply") as mock_reply:
            websocket.handle_unknown_message(message)

        mock_reply.assert_called_once_with(Any.dict.containing(["error"]), ok=False)
Exemplo n.º 2
0
    def test_error(self, matchers):
        message = websocket.Message(socket=mock.sentinel.socket, payload={
            'type': 'wibble',
        })

        with mock.patch.object(websocket.Message, 'reply') as mock_reply:
            websocket.handle_unknown_message(message)

        mock_reply.assert_called_once_with(matchers.MappingContaining('error'),
                                           ok=False)
Exemplo n.º 3
0
    def test_error(self, matchers):
        message = websocket.Message(socket=mock.sentinel.socket, payload={
            'type': 'wibble',
        })

        with mock.patch.object(websocket.Message, 'reply') as mock_reply:
            websocket.handle_unknown_message(message)

        mock_reply.assert_called_once_with(matchers.mapping_containing('error'),
                                           ok=False)
Exemplo n.º 4
0
    def test_error(self, matchers):
        message = websocket.Message(
            socket=mock.sentinel.socket, payload={"type": "wibble"}
        )

        with mock.patch.object(websocket.Message, "reply") as mock_reply:
            websocket.handle_unknown_message(message)

        mock_reply.assert_called_once_with(
            matchers.MappingContaining("error"), ok=False
        )