Skip to content

Commit 5f8000d

Browse files
Add artist and genre to MusicTrack and include unit tests
1 parent b4c98f2 commit 5f8000d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/test_didl_lite.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,3 +706,12 @@ def test_from_xml_string_unbound_prefix(self) -> None:
706706
assert "sub_title" in objs[0].__dict__
707707
assert objs[0].sub_title == "Test Subtitle"
708708
assert isinstance(objs[0], didl_lite.MusicTrack)
709+
710+
def test_music_track_artist_and_genre():
711+
from didl_lite.didl_lite import MusicTrack, to_xml_string
712+
track = MusicTrack(id="1", parent_id="0", title="Test", restricted="0", artist="My Artist", genre="My Genre")
713+
714+
xml = to_xml_string(track)
715+
716+
assert b"<upnp:artist>My Artist</upnp:artist>" in xml
717+
assert b"<upnp:genre>My Genre</upnp:genre>" in xml

0 commit comments

Comments
 (0)