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
示例#2
0
def run_scheduler():
    """Loads calendar and stars scheduler"""
    sch = Scheduler()
    try:
        sch.load_calendar(os.environ['CALENDAR'])
    except:
        pass

    sch.run()
    return sch