Esempio n. 1
0
    def test_check(self, faketoday, fakeutil):
        (faketoday
         .is_callable()
         .expects_call()
         .returns(
             datetime.datetime(2011, 12, 29, 22, 35, 44, 600000)
             )
         )

        (fakeutil
         .expects('load_state')
         .returns({})
         .expects('save_state')
         .expects('send_mail_smtp')
         .with_args(
             '*****@*****.**', ['*****@*****.**'],
             u'bi-weekly conference call (Fri December 30, 2011 00:00)',
             u'Weekly conference call\nLocation: IRC\nMeeting agenda '
             'and notes: http://example.com/notes/2011-12-30\n\nBe '
             'there or be square!',
             'localhost', 25)
         )

        test2_path = os.path.join(get_test_data_dir(), 'test2.ics')

        p = Phil(quiet=True, debug=False)
        p.config = Config(test2_path, 3, self.tempdir, 'localhost', 25,
                          '*****@*****.**', ['*****@*****.**'])
        p._run()
Esempio n. 2
0
def test_parse_ics():
    test1 = os.path.join(get_test_data_dir(), 'test1.ics')
    events = parse_ics(test1)

    eq_(len(events), 1)

    ev = events[0]
    eq_(ev.event_id, u'2011-11-18 12:00:00+00:00::bi-weekly conference call::')
    eq_(ev.summary, u'bi-weekly conference call')
    eq_(ev.description, u'conference call')
Esempio n. 3
0
def test_parse_ics():
    test1 = os.path.join(get_test_data_dir(), 'test1.ics')
    events = parse_ics(test1)

    eq_(len(events), 1)

    ev = events[0]
    eq_(ev.event_id, u'2011-11-18 12:00:00+00:00::bi-weekly conference call::')
    eq_(ev.summary, u'bi-weekly conference call')
    eq_(ev.description, u'conference call')
Esempio n. 4
0
def test_ics_description_expansion():
    test2 = os.path.join(get_test_data_dir(), 'test2.ics')
    events = parse_ics(test2)

    eq_(len(events), 1)

    ev = events[0]
    eq_(ev.description,
        u'Weekly conference call\nLocation: IRC\nMeeting agenda and notes: '
        'http://example.com/notes/%(Y)s-%(m)s-%(d)s\n\nBe there or be '
        'square!')
Esempio n. 5
0
def test_ics_description_expansion():
    test2 = os.path.join(get_test_data_dir(), 'test2.ics')
    events = parse_ics(test2)

    eq_(len(events), 1)

    ev = events[0]
    eq_(
        ev.description,
        u'Weekly conference call\nLocation: IRC\nMeeting agenda and notes: '
        'http://example.com/notes/%(Y)s-%(m)s-%(d)s\n\nBe there or be '
        'square!')
Esempio n. 6
0
    def test_check(self, faketoday, fakeutil):
        (faketoday.is_callable().expects_call().returns(
            datetime.datetime(2011, 12, 29, 22, 35, 44, 600000)))

        (fakeutil.expects('load_state').returns(
            {}).expects('save_state').expects('send_mail_smtp').with_args(
                '*****@*****.**', ['*****@*****.**'],
                u'bi-weekly conference call (Fri December 30, 2011 00:00)',
                u'Weekly conference call\nLocation: IRC\nMeeting agenda '
                'and notes: http://example.com/notes/2011-12-30\n\nBe '
                'there or be square!', 'localhost', 25))

        test2_path = os.path.join(get_test_data_dir(), 'test2.ics')

        p = Phil(quiet=True, debug=False)
        p.config = Config(test2_path, 3, self.tempdir, 'localhost', 25,
                          '*****@*****.**', ['*****@*****.**'])
        p._run()