From f9360bde15c8c9730f624425990e2c97a630bc6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Antunes?= Date: Tue, 6 Aug 2024 08:29:09 -0300 Subject: [PATCH] Fix test --- m3u8/parser.py | 2 +- tests/playlists.py | 8 ++++---- tests/test_model.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/m3u8/parser.py b/m3u8/parser.py index 28b2e155..c3a9e317 100644 --- a/m3u8/parser.py +++ b/m3u8/parser.py @@ -319,7 +319,7 @@ def _parse_attribute_list(prefix, line, attribute_parser, default_parser=None): params = ATTRIBUTELISTPATTERN.split(line.replace(prefix + ":", ""))[1::2] attributes = {} - if not line.startswith(prefix+':') : + if not line.startswith(prefix + ":"): return attributes for param in params: diff --git a/tests/playlists.py b/tests/playlists.py index 14338a31..c3403dbc 100755 --- a/tests/playlists.py +++ b/tests/playlists.py @@ -98,7 +98,7 @@ http://media.example.com/fileSequence52-3.ts """ -PLAYLIST_WITH_CUSTOM_MEDIA_HEADER = '''#EXTM3U +PLAYLIST_WITH_TAG_MEDIA_READY = """#EXTM3U #EXT-X-VERSION:3 #EXT-X-TARGETDURATION:6 #EXT-X-MEDIA-SEQUENCE:1 @@ -108,9 +108,9 @@ https://cdn.example.com/vod/hash:XXX/file.mp4/media-1.ts #EXTINF:6.28, https://cdn.example.com/vod/hash:XXX/file.mp4/media-2.ts -''' +""" -PLAYLIST_WITH_SESSION_ENCRYPTED_SEGMENTS = ''' +PLAYLIST_WITH_SESSION_ENCRYPTED_SEGMENTS = """ #EXTM3U #EXT-X-MEDIA-SEQUENCE:7794 #EXT-X-TARGETDURATION:15 @@ -123,7 +123,7 @@ http://media.example.com/fileSequence52-2.ts #EXTINF:15, http://media.example.com/fileSequence52-3.ts -''' +""" VARIANT_PLAYLIST = """ #EXTM3U diff --git a/tests/test_model.py b/tests/test_model.py index e87afab2..835db88b 100755 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -382,8 +382,8 @@ def test_session_key_attribute_without_initialization_vector(): assert None is obj.session_keys[0].iv -def test_parse_custom_media_header(): - obj = m3u8.M3U8(playlists.PLAYLIST_WITH_CUSTOM_MEDIA_HEADER) +def test_parse_tag_name_matches_fully(): + assert m3u8.M3U8(playlists.PLAYLIST_WITH_TAG_MEDIA_READY) def test_segments_attribute():