From: Jakob Cornell Date: Sat, 4 Jan 2020 04:47:31 +0000 (-0600) Subject: Add and update test cases X-Git-Url: https://jcornell.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=1600918092d3e1ac08a7d4c0a8c03fb5b1fa49a9;p=hls-watch.git Add and update test cases --- diff --git a/hls_watch/test.py b/hls_watch/test.py index aac9fe1..63d9f65 100644 --- a/hls_watch/test.py +++ b/hls_watch/test.py @@ -66,7 +66,7 @@ class TestCases(unittest.TestCase): ] ) - def test_static_mid(self): + def test_no_sync(self): self._run_case( [ [ @@ -116,6 +116,17 @@ class TestCases(unittest.TestCase): Segment('seg104', 12), Segment('seg105', 12), ], + [ + M3u(), + Version(3), + TargDur(15), + MediaSeq(102), + Segment('seg102', 15), + Segment('seg103', 12), + Segment('seg104', 12), + Segment('seg105', 12), + Segment('seg106', 12), + ], ], [ [ @@ -126,12 +137,13 @@ class TestCases(unittest.TestCase): Segment('seg103', 12), Segment('seg104', 12), Segment('seg105', 12), + Segment('seg106', 12), Endlist(), ], ] ) - def test_media_seq(self): + def test_zero_media_seq(self): self._run_case( [ [ @@ -290,6 +302,27 @@ class TestCases(unittest.TestCase): ] ) + def test_bad_targ_dur(self): + with self.assertRaises(ValueError): + self._run_case( + [ + [ + M3u(), + Version(3), + TargDur(12), + Segment('seg-0', 10), + ], + [ + M3u(), + Version(3), + TargDur(15), + MediaSeq(1), + Segment('seg-1', 10), + ], + ], + [] + ) + if __name__ == '__main__': unittest.main()