本文整理匯總了Python中mopidy.models.Album方法的典型用法代碼示例。如果您正苦於以下問題:Python models.Album方法的具體用法?Python models.Album怎麽用?Python models.Album使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mopidy.models
的用法示例。
在下文中一共展示了models.Album方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_find_includes_fake_artist_and_album_tracks
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_find_includes_fake_artist_and_album_tracks(self):
self.backend.library.dummy_find_exact_result = SearchResult(
albums=[Album(uri="dummy:album:a", name="A", date="2001")],
artists=[Artist(uri="dummy:artist:b", name="B")],
tracks=[Track(uri="dummy:track:c", name="C")],
)
self.send_request('find "any" "foo"')
self.assertInResponse("file: dummy:artist:b")
self.assertInResponse("Title: Artist: B")
self.assertInResponse("file: dummy:album:a")
self.assertInResponse("Title: Album: A")
self.assertInResponse("Date: 2001")
self.assertInResponse("file: dummy:track:c")
self.assertInResponse("Title: C")
self.assertInResponse("OK")
示例2: test_find_artist_does_not_include_fake_artist_tracks
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_find_artist_does_not_include_fake_artist_tracks(self):
self.backend.library.dummy_find_exact_result = SearchResult(
albums=[Album(uri="dummy:album:a", name="A", date="2001")],
artists=[Artist(uri="dummy:artist:b", name="B")],
tracks=[Track(uri="dummy:track:c", name="C")],
)
self.send_request('find "artist" "foo"')
self.assertNotInResponse("file: dummy:artist:b")
self.assertNotInResponse("Title: Artist: B")
self.assertInResponse("file: dummy:album:a")
self.assertInResponse("Title: Album: A")
self.assertInResponse("Date: 2001")
self.assertInResponse("file: dummy:track:c")
self.assertInResponse("Title: C")
self.assertInResponse("OK")
示例3: test_find_albumartist_does_not_include_fake_artist_tracks
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_find_albumartist_does_not_include_fake_artist_tracks(self):
self.backend.library.dummy_find_exact_result = SearchResult(
albums=[Album(uri="dummy:album:a", name="A", date="2001")],
artists=[Artist(uri="dummy:artist:b", name="B")],
tracks=[Track(uri="dummy:track:c", name="C")],
)
self.send_request('find "albumartist" "foo"')
self.assertNotInResponse("file: dummy:artist:b")
self.assertNotInResponse("Title: Artist: B")
self.assertInResponse("file: dummy:album:a")
self.assertInResponse("Title: Album: A")
self.assertInResponse("Date: 2001")
self.assertInResponse("file: dummy:track:c")
self.assertInResponse("Title: C")
self.assertInResponse("OK")
示例4: test_find_artist_and_album_does_not_include_fake_tracks
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_find_artist_and_album_does_not_include_fake_tracks(self):
self.backend.library.dummy_find_exact_result = SearchResult(
albums=[Album(uri="dummy:album:a", name="A", date="2001")],
artists=[Artist(uri="dummy:artist:b", name="B")],
tracks=[Track(uri="dummy:track:c", name="C")],
)
self.send_request('find "artist" "foo" "album" "bar"')
self.assertNotInResponse("file: dummy:artist:b")
self.assertNotInResponse("Title: Artist: B")
self.assertNotInResponse("file: dummy:album:a")
self.assertNotInResponse("Title: Album: A")
self.assertNotInResponse("Date: 2001")
self.assertInResponse("file: dummy:track:c")
self.assertInResponse("Title: C")
self.assertInResponse("OK")
示例5: test_search
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_search(self):
self.backend.library.dummy_search_result = SearchResult(
albums=[Album(uri="dummy:album:a", name="A")],
artists=[Artist(uri="dummy:artist:b", name="B")],
tracks=[Track(uri="dummy:track:c", name="C")],
)
self.send_request('search "any" "foo"')
self.assertInResponse("file: dummy:album:a")
self.assertInResponse("Title: Album: A")
self.assertInResponse("file: dummy:artist:b")
self.assertInResponse("Title: Artist: B")
self.assertInResponse("file: dummy:track:c")
self.assertInResponse("Title: C")
self.assertInResponse("OK")
示例6: test_currentsong
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_currentsong(self):
track = Track(uri="dummy:/a")
self.backend.library.dummy_library = [track]
self.core.tracklist.add(uris=[track.uri]).get()
self.core.playback.play().get()
self.send_request("currentsong")
self.assertInResponse("file: dummy:/a")
self.assertInResponse("Time: 0")
self.assertNotInResponse("Artist: ")
self.assertNotInResponse("Title: ")
self.assertNotInResponse("Album: ")
self.assertNotInResponse("Track: 0")
self.assertNotInResponse("Date: ")
self.assertInResponse("Pos: 0")
self.assertInResponse("Id: 1")
self.assertInResponse("OK")
示例7: test_track_to_mpd_format_for_nonempty_track
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_track_to_mpd_format_for_nonempty_track(self):
result = translator.track_to_mpd_format(
TlTrack(122, self.track), position=9
)
assert ("file", "à uri") in result
assert ("Time", 137) in result
assert ("Artist", "an artist") in result
assert ("Title", "a nàme") in result
assert ("Album", "an album") in result
assert ("AlbumArtist", "an other artist") in result
assert ("Composer", "a composer") in result
assert ("Performer", "a performer") in result
assert ("Genre", "a genre") in result
assert ("Track", "7/13") in result
assert ("Date", "1977-01-01") in result
assert ("Disc", 1) in result
assert ("Pos", 9) in result
assert ("Id", 122) in result
assert ("X-AlbumUri", "urischeme:àlbum:12345") in result
assert ("Comment", "a comment") not in result
assert len(result) == 15
示例8: test_list_artist_with_query_of_one_token
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_list_artist_with_query_of_one_token(self):
self.send_request('list "artist" "anartist"')
self.assertEqualResponse(
'ACK [2@0] {list} should be "Album" for 3 arguments'
)
示例9: test_list_albumartist_should_not_return_artists_without_names
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_list_albumartist_should_not_return_artists_without_names(self):
self.backend.library.dummy_find_exact_result = SearchResult(
tracks=[Track(album=Album(artists=[Artist(name="")]))]
)
self.send_request('list "albumartist"')
self.assertNotInResponse("Artist: ")
self.assertNotInResponse("Albumartist: ")
self.assertNotInResponse("Composer: ")
self.assertNotInResponse("Performer: ")
self.assertInResponse("OK")
# Composer
示例10: test_list_composer_with_query_of_one_token
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_list_composer_with_query_of_one_token(self):
self.send_request('list "composer" "anartist"')
self.assertEqualResponse(
'ACK [2@0] {list} should be "Album" for 3 arguments'
)
示例11: test_list_performer_with_query_of_one_token
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_list_performer_with_query_of_one_token(self):
self.send_request('list "performer" "anartist"')
self.assertEqualResponse(
'ACK [2@0] {list} should be "Album" for 3 arguments'
)
示例12: test_list_album_without_quotes_and_capitalized
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_list_album_without_quotes_and_capitalized(self):
self.send_request("list Album")
self.assertInResponse("OK")
示例13: test_list_album_with_artist_name
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_list_album_with_artist_name(self):
self.backend.library.dummy_get_distinct_result = {"album": {"foo"}}
self.send_request('list "album" "anartist"')
self.assertInResponse("Album: foo")
self.assertInResponse("OK")
示例14: test_list_date_with_query_of_one_token
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_list_date_with_query_of_one_token(self):
self.send_request('list "date" "anartist"')
self.assertEqualResponse(
'ACK [2@0] {list} should be "Album" for 3 arguments'
)
示例15: test_list_genre_with_query_of_one_token
# 需要導入模塊: from mopidy import models [as 別名]
# 或者: from mopidy.models import Album [as 別名]
def test_list_genre_with_query_of_one_token(self):
self.send_request('list "genre" "anartist"')
self.assertEqualResponse(
'ACK [2@0] {list} should be "Album" for 3 arguments'
)