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"
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"