def test_hls_stream_master(session, common_args):
    stream = HLSStream(session, "http://host/stream.m3u8?foo=bar",
                       "http://host/master.m3u8?foo=bar", **common_args)
    assert stream.to_url(
    ) == "http://host/stream.m3u8?foo=bar&queryparamkey=queryparamval"
    assert stream.to_manifest_url(
    ) == "http://host/master.m3u8?foo=bar&queryparamkey=queryparamval"
def test_hls_stream(session, common_args):
    stream = HLSStream(session, "http://host/stream.m3u8?foo=bar",
                       **common_args)
    assert stream.to_url(
    ) == "http://host/stream.m3u8?foo=bar&queryparamkey=queryparamval"
    with pytest.raises(TypeError) as cm:
        stream.to_manifest_url()
    assert str(
        cm.value) == "<HLSStream [hls]> cannot be translated to a manifest URL"
예제 #3
0
 def test_hls_stream(self):
     expected = "http://test.se/stream.m3u8"
     stream = HLSStream(self.session, expected)
     self.assertEqual(expected, stream_to_url(stream))
     self.assertEqual(expected, stream.to_url())