Esempio n. 1
0
def test_add_unregistered_media_with_replace_flag_set():
    en_sub = Media(group_id='subs', type='SUBTITLES', name='English subs',
                   uri='en_subs.vtt')
    media_list = MediaList()

    media_list.add(en_sub, replace=True)

    assert len(media_list) == 1
Esempio n. 2
0
def test_equivalent_media_element_added_if_specified():
    en_sub_1 = Media(group_id='subs', type='SUBTITLES', name='English subs',
                     uri='en_subs.vtt')
    en_sub_2 = Media(group_id='subs', type='SUBTITLES', name='English subs',
                     uri='en_subs_2.vtt', default='YES')
    media_list = MediaList([en_sub_1])

    media_list.add(en_sub_2, replace=True)

    assert len(media_list) == 1
    en_sub = media_list.pop()
    assert en_sub.uri == 'en_subs_2.vtt' and en_sub.default == 'YES'