# Path: ntfy/backends/simplepush.py
# def notify(title, message, key, event=None, retcode=None):
#     """
#     Required paramter:
#         * ``key`` - The Simplepush identification key, created by
#         installing the Android App (https://simplepush.io)
# 
#     Optional parameters:
#         * ``event`` - use custom ringtones and vibration patterns
#     """
# 
#     data = {
#         'title': title if len(title) <= 20 else title[:19] + u'\u2026',
#         'msg': message,
#         'key': key
#     }
# 
#     if event:
#         data['event'] = event
# 
#     headers = {'User-Agent': USER_AGENT}
# 
#     endpoint = "https://api.simplepush.io"
# 
#     resp = requests.post(endpoint + '/send', data=data, headers=headers)
# 
#     resp.raise_for_status()
# 
# Path: ntfy/config.py
# USER_AGENT = 'ntfy/{version} {default_user_agent}'.format(
#     version=__version__,
#     default_user_agent=requests.utils.default_user_agent())


from unittest import TestCase
from mock import patch
from ntfy.backends.simplepush import notify
from ntfy.config import USER_AGENT



class TestSimplepush(TestCase):
    @patch('requests.post')
    def test_basic(self, mock_post):

# Path: ntfy/backends/simplepush.py
# def notify(title, message, key, event=None, retcode=None):
#     """
#     Required paramter:
#         * ``key`` - The Simplepush identification key, created by
#         installing the Android App (https://simplepush.io)
# 
#     Optional parameters:
#         * ``event`` - use custom ringtones and vibration patterns
#     """
# 
#     data = {
#         'title': title if len(title) <= 20 else title[:19] + u'\u2026',
#         'msg': message,
#         'key': key
#     }
# 
#     if event:
#         data['event'] = event
# 
#     headers = {'User-Agent': USER_AGENT}
# 
#     endpoint = "https://api.simplepush.io"
# 
#     resp = requests.post(endpoint + '/send', data=data, headers=headers)
# 
#     resp.raise_for_status()
# 
# Path: ntfy/config.py
# USER_AGENT = 'ntfy/{version} {default_user_agent}'.format(
#     version=__version__,
#     default_user_agent=requests.utils.default_user_agent())


# Path: tests/test_simplepush.py
from unittest import TestCase
from mock import patch
from ntfy.backends.simplepush import notify
from ntfy.config import USER_AGENT




class TestSimplepush(TestCase):
    @patch('requests.post')
    def test_basic(self, mock_post):

        notify('title', 'message', key='secret')