# Path: ntfy/backends/prowl.py
# API_URL = 'https://api.prowlapp.com/publicapi/add'
# 
# NTFY_API_KEY = '7fb59b2bedc4df26afa306d5dc54495b6394295a'
# 
# def notify(title,
#            message,
#            api_key=NTFY_API_KEY,
#            provider_key=None,
#            priority=0,
#            url=None,
#            retcode=None):
#     """
#     Optional parameters:
#         * ``api_key`` - use your own application token
#         * ``provider_key`` - if you are whitelisted
#         * ``priority``
#         * ``url``
#     """
# 
#     data = {
#         'apikey': api_key,
#         'application': 'ntfy',
#         'event': title,
#         'description': message,
#     }
# 
#     if MIN_PRIORITY <= priority <= MAX_PRIORITY:
#         data['priority'] = priority
#     else:
#         raise ValueError('priority must be an integer from {:d} to {:d}'
#                          .format(MIN_PRIORITY, MAX_PRIORITY))
# 
#     if url is not None:
#         data['url'] = url
# 
#     if provider_key is not None:
#         data['providerkey'] = provider_key
# 
#     resp = requests.post(
#         API_URL, data=data, headers={
#             'User-Agent': USER_AGENT,
#         })
# 
#     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, main
from mock import patch
from ntfy.backends.prowl import API_URL, NTFY_API_KEY, notify
from ntfy.config import USER_AGENT


TITLE = 'title'
MESSAGE = 'message'


class TestProwl(TestCase):
    def setUp(self):
        self.post_patcher = patch('requests.post')
        self.response_patcher = patch('requests.Response')
        self.mock_post = self.post_patcher.start()
        self.mock_response = self.response_patcher.start()
        self.mock_post.return_value = self.mock_response

    def tearDown(self):
        self.post_patcher.stop()
        self.response_patcher.stop()

    def verify_post(self, priority=0, **kwargs):
        data = {

# Path: ntfy/backends/prowl.py
# API_URL = 'https://api.prowlapp.com/publicapi/add'
# 
# NTFY_API_KEY = '7fb59b2bedc4df26afa306d5dc54495b6394295a'
# 
# def notify(title,
#            message,
#            api_key=NTFY_API_KEY,
#            provider_key=None,
#            priority=0,
#            url=None,
#            retcode=None):
#     """
#     Optional parameters:
#         * ``api_key`` - use your own application token
#         * ``provider_key`` - if you are whitelisted
#         * ``priority``
#         * ``url``
#     """
# 
#     data = {
#         'apikey': api_key,
#         'application': 'ntfy',
#         'event': title,
#         'description': message,
#     }
# 
#     if MIN_PRIORITY <= priority <= MAX_PRIORITY:
#         data['priority'] = priority
#     else:
#         raise ValueError('priority must be an integer from {:d} to {:d}'
#                          .format(MIN_PRIORITY, MAX_PRIORITY))
# 
#     if url is not None:
#         data['url'] = url
# 
#     if provider_key is not None:
#         data['providerkey'] = provider_key
# 
#     resp = requests.post(
#         API_URL, data=data, headers={
#             'User-Agent': USER_AGENT,
#         })
# 
#     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_prowl.py
from unittest import TestCase, main
from mock import patch
from ntfy.backends.prowl import API_URL, NTFY_API_KEY, notify
from ntfy.config import USER_AGENT



TITLE = 'title'
MESSAGE = 'message'


class TestProwl(TestCase):
    def setUp(self):
        self.post_patcher = patch('requests.post')
        self.response_patcher = patch('requests.Response')
        self.mock_post = self.post_patcher.start()
        self.mock_response = self.response_patcher.start()
        self.mock_post.return_value = self.mock_response

    def tearDown(self):
        self.post_patcher.stop()
        self.response_patcher.stop()

    def verify_post(self, priority=0, **kwargs):
        data = {

            'apikey': NTFY_API_KEY,