Exemplo n.º 1
0
    def test_send_message_exception(self, request_mock):
        request_mock.side_effect = requests.RequestException
        api = PushoverApi('SECRET_TOKEN')

        with pytest.raises(PushoverException) as exc:
            api.send_message({})

        assert isinstance(exc.value.args[0], requests.RequestException) is True
Exemplo n.º 2
0
    def test_send_message(self, request_mock):
        request_mock.return_value = requests.Response()
        api = PushoverApi('SECRET_TOKEN')

        assert isinstance(api.send_message({}), requests.Response) is True