コード例 #1
0
def test_multiple_vevents(icaltomapi, message):
    ical = open(os.path.join(dir_path, 'ics/multiple_vevents.ics'),
                'rb').read()
    subjects = [
        b'What is the meaning of life the universe and everything?', b'42'
    ]

    assert_item_count_from_ical(icaltomapi, ical, len(subjects))
    assert_property_value_from_ical(icaltomapi, message, PR_SUBJECT, subjects)
コード例 #2
0
def test_multiple_vcalenders(icaltomapi, message):
    ical = open(os.path.join(dir_path, 'ics/multiple_vcalendar.ics'),
                'rb').read()
    subjects = [
        b'super summary', b'mega summary', b'uber summer', b'it\'s summer!'
    ]

    assert_item_count_from_ical(icaltomapi, ical, len(subjects))
    assert_property_value_from_ical(icaltomapi, message, PR_SUBJECT, subjects)
コード例 #3
0
ファイル: test_successes.py プロジェクト: umgfoin/kopano-core
def test_microsoft_style_not_all_day_if_not_midnight_incorrect(store, icaltomapi, message):
    ical = open(os.path.join(dir_path, 'ics/allday_ms_style_incorrect.ics'), 'rb').read()

    # As defined in namedprops.h
    DISPID_ALL_DAY_EVENT = 0x8215

    ALL_DAY_NAMEID = MAPINAMEID(PSETID_Appointment, MNID_ID, DISPID_ALL_DAY_EVENT)
    ALL_DAY_PROP = CHANGE_PROP_TYPE(
        store.GetIDsFromNames([ALL_DAY_NAMEID], MAPI_CREATE)[0],
        PT_BOOLEAN
    )

    EXPECTED_MESSAGES = 1
    IS_ALL_DAY = [False]

    assert_item_count_from_ical(icaltomapi, ical, EXPECTED_MESSAGES)
    assert_property_value_from_ical(icaltomapi, message, ALL_DAY_PROP, IS_ALL_DAY)