# Path: ntfy/backends/pushalot.py
# def notify(title,
#            message,
#            auth_token,
#            source=None,
#            url=None,
#            url_title=None,
#            image=None,
#            ttl=None,
#            important=False,
#            silent=False,
#            retcode=None):
#     """
#     Required parameters:
#         * ``auth_token``
# 
#     Optional parameters:
#         * ``source``
#         * ``url``
#         * ``url_title``
#         * ``image``
#         * ``ttl``
#         * ``important``
#         * ``silent``
#     """
# 
#     data = {
#         'Title': title,
#         'Body': message,
#         'AuthorizationToken': auth_token,
#     }
# 
#     if source:
#         data['Source'] = source
#     if url:
#         data['Link'] = url
#     if url and url_title:
#         data['LinkTitle'] = url_title
#     if image:
#         data['Image'] = image
#     if ttl:
#         data['TimeToLive'] = int(ttl)
#     if important:
#         data['IsImportant'] = 'True'
#     if silent:
#         data['IsSilent'] = 'True'
# 
#     headers = {'User-Agent': USER_AGENT}
#     response = requests.post(PUSHALOT_API_URL, data=data, headers=headers)
#     response.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, main
from mock import patch
from ntfy.backends.pushalot import notify
from ntfy.config import USER_AGENT



class TestPushalot(TestCase):
    URL = 'https://pushalot.com/api/sendmessage'

    @patch('requests.post')
    def test_basic(self, mock_post):
        notify('title', 'message', auth_token='access_token')
        mock_post.assert_called_once_with(
            self.URL,
            data={
                'Body': 'message',
                'Title': 'title',
                'AuthorizationToken': 'access_token'
            },

# Path: ntfy/backends/pushalot.py
# def notify(title,
#            message,
#            auth_token,
#            source=None,
#            url=None,
#            url_title=None,
#            image=None,
#            ttl=None,
#            important=False,
#            silent=False,
#            retcode=None):
#     """
#     Required parameters:
#         * ``auth_token``
# 
#     Optional parameters:
#         * ``source``
#         * ``url``
#         * ``url_title``
#         * ``image``
#         * ``ttl``
#         * ``important``
#         * ``silent``
#     """
# 
#     data = {
#         'Title': title,
#         'Body': message,
#         'AuthorizationToken': auth_token,
#     }
# 
#     if source:
#         data['Source'] = source
#     if url:
#         data['Link'] = url
#     if url and url_title:
#         data['LinkTitle'] = url_title
#     if image:
#         data['Image'] = image
#     if ttl:
#         data['TimeToLive'] = int(ttl)
#     if important:
#         data['IsImportant'] = 'True'
#     if silent:
#         data['IsSilent'] = 'True'
# 
#     headers = {'User-Agent': USER_AGENT}
#     response = requests.post(PUSHALOT_API_URL, data=data, headers=headers)
#     response.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_pushalot.py
from unittest import TestCase, main
from mock import patch
from ntfy.backends.pushalot import notify
from ntfy.config import USER_AGENT




class TestPushalot(TestCase):
    URL = 'https://pushalot.com/api/sendmessage'

    @patch('requests.post')
    def test_basic(self, mock_post):
        notify('title', 'message', auth_token='access_token')
        mock_post.assert_called_once_with(
            self.URL,
            data={
                'Body': 'message',
                'Title': 'title',
                'AuthorizationToken': 'access_token'
            },

            headers={'User-Agent': USER_AGENT})