Esempio n. 1
0
    def test_send_unprocessable(self):
        pusher = Pusher()
        notification = self._create_mocked_notification()
        response = self._create_mocked_response(code=400)

        pusher._agent.request = Mock(return_value=response)
        pusher._processResponse = Mock()
        pusher._processErrorResponse = Mock()

        pusher.send(notification)

        pusher._processErrorResponse.assert_called_once_with(response)
        self.assertFalse(pusher._processResponse.called)
Esempio n. 2
0
    def test_send_unprocessable(self):
        pusher = Pusher()
        notification = self._create_mocked_notification()
        response = self._create_mocked_response(code=400)

        pusher._agent.request = Mock(return_value=response)
        pusher._processResponse = Mock()
        pusher._processErrorResponse = Mock()

        pusher.send(notification)

        pusher._processErrorResponse.assert_called_once_with(response)
        self.assertFalse(pusher._processResponse.called)