def test_PushoverNotifierBackend_raises_exception_when_a_bad_notification_is_provided(mock_pushover_server, mock_bad_notification):
    testPushoverNotifierBackend = PushoverNotifierBackend(TEST_TOKEN, TEST_USER, TEST_DEVICE)
    with pytest.raises(AttributeError):
        testPushoverNotifierBackend.dispatch_notification(mock_bad_notification)
def test_PushoverNotifierBackend_raises_exception_when_server_down(mock_bad_pushover_server, mock_simple_notification):
    testPushoverNotifierBackend = PushoverNotifierBackend(TEST_TOKEN, TEST_USER, TEST_DEVICE)
    with pytest.raises(EventNotifierNotificationDispatchException):
        testPushoverNotifierBackend.dispatch_notification(mock_simple_notification)
def test_PushoverNotifierBackend_sends_valid_complex_notification(mock_pushover_server, mock_complex_notification):
    testPushoverNotifierBackend = PushoverNotifierBackend(TEST_TOKEN, TEST_USER, TEST_DEVICE)
    assert testPushoverNotifierBackend.dispatch_notification(mock_complex_notification)