Browse Source

test Track.get_comment()

Fabian Peter Hammerle 6 years ago
parent
commit
d009b8d44a
2 changed files with 9 additions and 0 deletions
  1. 9 0
      tests/test_track.py
  2. BIN
      tests/tracks/id3v2.4-typical.mp3

+ 9 - 0
tests/test_track.py

@@ -34,6 +34,15 @@ def test_init(path):
     symuid.Track(path)
 
 
+@pytest.mark.parametrize(('path', 'expected_comment'), [
+    (os.path.join(TRACKS_DIR_PATH, 'id3v2.4-typical.mp3'), 'some comment'),
+    (os.path.join(TRACKS_DIR_PATH, 'id3v2.4-empty.mp3'), None),
+])
+def test_get_comment(path, expected_comment):
+    t = symuid.Track(path)
+    assert expected_comment == t.comment
+
+
 @pytest.mark.parametrize(('pc'), [
     symuid.PlayCount('pytest', 'lib', utc_dt(), 7),
 ])

BIN
tests/tracks/id3v2.4-typical.mp3