# Path: pushkin/sender/nordifier/constants.py
# SN_GUEST = 0
# SN_FACEBOOK = 1
# SN_GOOGLE = 2
# PLATFORM_ANDROID = 1
# PLATFORM_IPHONE = 2
# PLATFORM_IPAD = 5
# PLATFORM_ANDROID_TABLET = 6
# PLATFORM_BY_PROVIDER = {
#     PLATFORM_ANDROID: 1,
#     PLATFORM_ANDROID_TABLET: 1,
#     PLATFORM_IPHONE: 2,
#     PLATFORM_IPAD: 2,
# }
# NOTIFICATION_CONTROL_GROUP = -2
# NOTIFICATION_READY = -1
# NOTIFICATION_SUCCESS = 0
# NOTIFICATION_UNKNOWN_ERROR = 1
# NOTIFICATION_CONNECTION_ERROR = 2
# NOTIFICATION_EXPIRED = 3
# NOTIFICATION_UNKNOWN_PLATFORM = 4
# NOTIFICATION_SENDER_QUEUE_LIMIT = 5
# NOTIFICATION_GCM_FATAL_ERROR = 100
# NOTIFICATION_GCM_UNAVAILABLE = 101
# NOTIFICATION_GCM_INVALID_REGISTRATION_ID = 102
# NOTIFICATION_GCM_DEVICE_UNREGISTERED = 103
# NOTIFICATION_APNS_MALFORMED_ERROR = 200
# NOTIFICATION_APNS_DEVICE_UNREGISTERED = 201
# TIME_TO_LIVE_HOURS = 6
# 
# Path: pushkin/sender/sender_manager.py
# class NotificationSenderManager():
#     def __init__(self):
#     def submit(self, notification):
#     def start(self):


import mock
import pytest
from pushkin.sender.nordifier import constants
from pushkin.sender import sender_manager



APN = 'pushkin.sender.senders.ApnNotificationSender'
GCM = 'pushkin.sender.senders.GcmNotificationSender'


@mock.patch('pushkin.sender.sender_manager.config')
def test_sender_manager_init_no_senders_given(mock_config):
    mock_config.enabled_senders.split.return_value=[]
    with pytest.raises(SystemExit) as ex:
        sender_manager.NotificationSenderManager()
    assert ("Nothing to start. At least one sender class "
            "must be specified in config") in str(ex)

@mock.patch(APN)
@mock.patch(GCM)
def test_sender_manager_init_bad_subclass(mock_gcm, mock_apn):
    with pytest.raises(SystemExit) as ex:

# Path: pushkin/sender/nordifier/constants.py
# SN_GUEST = 0
# SN_FACEBOOK = 1
# SN_GOOGLE = 2
# PLATFORM_ANDROID = 1
# PLATFORM_IPHONE = 2
# PLATFORM_IPAD = 5
# PLATFORM_ANDROID_TABLET = 6
# PLATFORM_BY_PROVIDER = {
#     PLATFORM_ANDROID: 1,
#     PLATFORM_ANDROID_TABLET: 1,
#     PLATFORM_IPHONE: 2,
#     PLATFORM_IPAD: 2,
# }
# NOTIFICATION_CONTROL_GROUP = -2
# NOTIFICATION_READY = -1
# NOTIFICATION_SUCCESS = 0
# NOTIFICATION_UNKNOWN_ERROR = 1
# NOTIFICATION_CONNECTION_ERROR = 2
# NOTIFICATION_EXPIRED = 3
# NOTIFICATION_UNKNOWN_PLATFORM = 4
# NOTIFICATION_SENDER_QUEUE_LIMIT = 5
# NOTIFICATION_GCM_FATAL_ERROR = 100
# NOTIFICATION_GCM_UNAVAILABLE = 101
# NOTIFICATION_GCM_INVALID_REGISTRATION_ID = 102
# NOTIFICATION_GCM_DEVICE_UNREGISTERED = 103
# NOTIFICATION_APNS_MALFORMED_ERROR = 200
# NOTIFICATION_APNS_DEVICE_UNREGISTERED = 201
# TIME_TO_LIVE_HOURS = 6
# 
# Path: pushkin/sender/sender_manager.py
# class NotificationSenderManager():
#     def __init__(self):
#     def submit(self, notification):
#     def start(self):


# Path: pushkin/tests/test_sender_manager.py
import mock
import pytest
from pushkin.sender.nordifier import constants
from pushkin.sender import sender_manager




APN = 'pushkin.sender.senders.ApnNotificationSender'
GCM = 'pushkin.sender.senders.GcmNotificationSender'


@mock.patch('pushkin.sender.sender_manager.config')
def test_sender_manager_init_no_senders_given(mock_config):
    mock_config.enabled_senders.split.return_value=[]
    with pytest.raises(SystemExit) as ex:
        sender_manager.NotificationSenderManager()
    assert ("Nothing to start. At least one sender class "
            "must be specified in config") in str(ex)

@mock.patch(APN)
@mock.patch(GCM)
def test_sender_manager_init_bad_subclass(mock_gcm, mock_apn):
    with pytest.raises(SystemExit) as ex:

        sender_manager.NotificationSenderManager()