本文整理汇总了Python中mopidy.models.Ref.artist方法的典型用法代码示例。如果您正苦于以下问题:Python Ref.artist方法的具体用法?Python Ref.artist怎么用?Python Ref.artist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mopidy.models.Ref
的用法示例。
在下文中一共展示了Ref.artist方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_artist_ref
# 需要导入模块: from mopidy.models import Ref [as 别名]
# 或者: from mopidy.models.Ref import artist [as 别名]
def test_artist_ref():
assert translator.ref({
'DisplayName': 'Foo',
'URI': BASEURI + '/foo',
'Type': 'container',
'TypeEx': ARTIST_TYPE
}) == Ref.artist(uri=BASEURI+'/foo', name='Foo')
示例2: test_listall_without_uri
# 需要导入模块: from mopidy.models import Ref [as 别名]
# 或者: from mopidy.models.Ref import artist [as 别名]
def test_listall_without_uri(self):
tracks = [Track(uri='dummy:/a', name='a'),
Track(uri='dummy:/foo/b', name='b')]
self.backend.library.dummy_library = tracks
self.backend.library.dummy_browse_result = {
'dummy:/': [Ref.track(uri='dummy:/a', name='a'),
Ref.directory(uri='dummy:/foo', name='foo'),
Ref.album(uri='dummy:/album', name='album'),
Ref.artist(uri='dummy:/artist', name='artist'),
Ref.playlist(uri='dummy:/pl', name='pl')],
'dummy:/foo': [Ref.track(uri='dummy:/foo/b', name='b')]}
self.send_request('listall')
self.assertInResponse('file: dummy:/a')
self.assertInResponse('directory: /dummy/foo')
self.assertInResponse('directory: /dummy/album')
self.assertInResponse('directory: /dummy/artist')
self.assertInResponse('directory: /dummy/pl')
self.assertInResponse('file: dummy:/foo/b')
self.assertInResponse('OK')
示例3: ref
# 需要导入模块: from mopidy.models import Ref [as 别名]
# 或者: from mopidy.models.Ref import artist [as 别名]
def ref(artist):
return Ref.artist(name=artist.name, uri=artist.uri)
示例4: test_artist_constructor
# 需要导入模块: from mopidy.models import Ref [as 别名]
# 或者: from mopidy.models.Ref import artist [as 别名]
def test_artist_constructor(self):
ref = Ref.artist(uri='foo', name='bar')
self.assertEqual(ref.uri, 'foo')
self.assertEqual(ref.name, 'bar')
self.assertEqual(ref.type, Ref.ARTIST)
示例5: create_artist
# 需要导入模块: from mopidy.models import Ref [as 别名]
# 或者: from mopidy.models.Ref import artist [as 别名]
def create_artist(tidal_artist):
return Ref.artist(uri="tidal:artist:" + str(tidal_artist.id),
name=tidal_artist.name)