From 1600918092d3e1ac08a7d4c0a8c03fb5b1fa49a9 Mon Sep 17 00:00:00 2001 From: Jakob Cornell Date: Fri, 3 Jan 2020 22:47:31 -0600 Subject: [PATCH] Add and update test cases --- hls_watch/test.py | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) 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() -- 2.30.2