# Path: ntfy/backends/notifico.py
# def notify(title, message, retcode=None, webhook=None):
#     """
#     Required parameter:
#         * ``webhook`` - The webhook link, created at https://n.tkte.ch/
#               (choose ``Plain Text`` service when creating the webhook)
#     """
# 
#     logger = logging.getLogger(__name__)
#     if webhook is None:
#         logger.error('please set webhook variable under '
#                      'notifico backend of the config file')
#         return
#     response = requests.get(
#         webhook,
#         params={
#             'payload': '{title}\n{message}'.format(
#                 title=title, message=message)
#         })
#     response.raise_for_status()


from unittest import TestCase, main
from requests import HTTPError, Response
from mock import patch
from ntfy.backends.notifico import notify




class TestNotifico(TestCase):
    def setUp(self):
        self.webhook = 'https://n.tkte.ch/h/1234/testing_webhook'

    @patch('requests.get')
    def test_basic(self, mock_get):
        resp = Response()
        resp.status_code = 200
        mock_get.return_value = resp

# Path: ntfy/backends/notifico.py
# def notify(title, message, retcode=None, webhook=None):
#     """
#     Required parameter:
#         * ``webhook`` - The webhook link, created at https://n.tkte.ch/
#               (choose ``Plain Text`` service when creating the webhook)
#     """
# 
#     logger = logging.getLogger(__name__)
#     if webhook is None:
#         logger.error('please set webhook variable under '
#                      'notifico backend of the config file')
#         return
#     response = requests.get(
#         webhook,
#         params={
#             'payload': '{title}\n{message}'.format(
#                 title=title, message=message)
#         })
#     response.raise_for_status()


# Path: tests/test_notifico.py
from unittest import TestCase, main
from requests import HTTPError, Response
from mock import patch
from ntfy.backends.notifico import notify





class TestNotifico(TestCase):
    def setUp(self):
        self.webhook = 'https://n.tkte.ch/h/1234/testing_webhook'

    @patch('requests.get')
    def test_basic(self, mock_get):
        resp = Response()
        resp.status_code = 200
        mock_get.return_value = resp

        notify('title', 'message', webhook=self.webhook)