本文整理汇总了Python中mopidy.models.Track.serialize方法的典型用法代码示例。如果您正苦于以下问题:Python Track.serialize方法的具体用法?Python Track.serialize怎么用?Python Track.serialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mopidy.models.Track
的用法示例。
在下文中一共展示了Track.serialize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_serialize_with_tracks
# 需要导入模块: from mopidy.models import Track [as 别名]
# 或者: from mopidy.models.Track import serialize [as 别名]
def test_serialize_with_tracks(self):
track = Track(name="foo")
self.assertDictEqual(
{"__model__": "Playlist", "uri": "uri", "name": "name", "tracks": [track.serialize()]},
Playlist(uri="uri", name="name", tracks=[track]).serialize(),
)
示例2: test_serialize_with_tracks
# 需要导入模块: from mopidy.models import Track [as 别名]
# 或者: from mopidy.models.Track import serialize [as 别名]
def test_serialize_with_tracks(self):
track = Track(name='foo')
self.assertDictEqual(
{'__model__': 'Playlist', 'uri': 'uri', 'name': 'name',
'tracks': [track.serialize()]},
Playlist(uri='uri', name='name', tracks=[track]).serialize())
示例3: test_serialize
# 需要导入模块: from mopidy.models import Track [as 别名]
# 或者: from mopidy.models.Track import serialize [as 别名]
def test_serialize(self):
track = Track(uri="uri", name="name")
self.assertDictEqual(
{"__model__": "TlTrack", "tlid": 123, "track": track.serialize()},
TlTrack(tlid=123, track=track).serialize(),
)
示例4: test_serialize
# 需要导入模块: from mopidy.models import Track [as 别名]
# 或者: from mopidy.models.Track import serialize [as 别名]
def test_serialize(self):
track = Track(uri='uri', name='name')
self.assertDictEqual(
{'__model__': 'TlTrack', 'tlid': 123, 'track': track.serialize()},
TlTrack(tlid=123, track=track).serialize())