Ejemplo n.º 1
0
 def test_overwrite(self, hls_server, monkeypatch):
     monkeypatch.setattr(sys, "argv", ["-", hls_server.good_playlist])
     assert caterpillar.main() == 0
     assert caterpillar.main() == 1
     monkeypatch.setattr(sys, "argv", ["-", "-f", hls_server.good_playlist])
     assert caterpillar.main() == 0
     assert os.path.isfile("good.mp4")
     assert not os.path.exists("good")
Ejemplo n.º 2
0
 def test_variant_streams(self, hls_server, monkeypatch):
     monkeypatch.setattr(
         sys, "argv", ["-", hls_server.variants_playlist, "variant.mp4"]
     )
     assert caterpillar.main() == 0
     assert os.path.isfile("variant.mp4")
     # Make sure the 720p variant is the one downloaded, not the 480p one.
     assert re.search(r"Video:.*1280x720", probe("variant.mp4"))
Ejemplo n.º 3
0
 def test_empty_playlist(self, hls_server, monkeypatch):
     monkeypatch.setattr(sys, "argv", ["-", hls_server.empty_playlist])
     assert caterpillar.main() == 1
     assert os.path.isdir("empty")
     assert not os.path.isfile("empty.mp4")
Ejemplo n.º 4
0
 def test_keep(self, hls_server, monkeypatch):
     monkeypatch.setattr(sys, "argv", ["-", "-k", hls_server.good_playlist])
     assert caterpillar.main() == 0
     assert os.path.isfile("good.mp4")
     assert os.path.isdir("good")
Ejemplo n.º 5
0
 def try_extention(ext):
     output = f"good.{ext}"
     monkeypatch.setattr(sys, "argv", ["-", "-m", mode, playlist, output])
     assert caterpillar.main() == 0
     assert os.path.isfile(output)
Ejemplo n.º 6
0
 def test_output_file(self, hls_server, monkeypatch):
     monkeypatch.setattr(sys, "argv", ["-", hls_server.good_playlist, "good.ts"])
     assert caterpillar.main() == 0
     assert os.path.isfile("good.ts")
     assert not os.path.exists("good")
Ejemplo n.º 7
0
 def test_containers(self, hls_server, monkeypatch):
     monkeypatch.setattr(sys, "argv",
                         ["-", hls_server.good_playlist, "good.flv"])
     assert caterpillar.main() == 0
     assert os.path.isfile("good.flv")