def test_load_some_events_calendar(capsys):
    sch = Scheduler()
    sch.load_calendar(calendar_file='tests/some_events.ics')
    events = sch.get_events()
    p = capsys.readouterr()
    cp = capsys.readouterr()
    assert not cp.out
    assert not cp.err
    assert events
def test_process_mail(capsys):
    sch = Scheduler()
    event = Scheduler.create_event('test', '2221-01-30 19:25:00', how='mail')

    sch.process_event(event)

    events = sch.get_events()
    p = capsys.readouterr()
    cp = capsys.readouterr()
    assert not cp.out
    assert not cp.err
    assert events
def test_process_sms(capsys):
    sch = Scheduler()
    event = Scheduler.create_event('test', '2221-01-30 19:25:00', how='SMS')

    with pytest.raises(Exception) as excinfo:
        sch.process_event(event)

    events = sch.get_events()
    p = capsys.readouterr()
    cp = capsys.readouterr()
    assert not cp.out
    assert not cp.err
    assert not events