def test_should_correctly_update_base_path_if_its_blank(): segment = Segment('entire.ts', 'http://1.2/') assert not segment.base_path segment.base_path = "base_path" assert "http://1.2/base_path/entire.ts" == segment.absolute_uri
def test_base_path_should_just_return_uri_if_absolute(): segment = Segment('http://1.2/entire.ts', '') assert 'http://1.2/entire.ts' == segment.absolute_uri
def test_add_segment_to_playlist(): obj = m3u8.M3U8() obj.add_segment(Segment('entire.ts', 'http://1.2/', duration=1))