当前位置: 首页>>代码示例>>Python>>正文


Python models.Album方法代码示例

本文整理汇总了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") 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:22,代码来源:test_music_db.py

示例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") 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:22,代码来源:test_music_db.py

示例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") 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:22,代码来源:test_music_db.py

示例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") 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:22,代码来源:test_music_db.py

示例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") 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:19,代码来源:test_music_db.py

示例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") 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:19,代码来源:test_status.py

示例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 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:23,代码来源:test_translator.py

示例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'
        ) 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:7,代码来源:test_music_db.py

示例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 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:15,代码来源:test_music_db.py

示例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'
        ) 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:7,代码来源:test_music_db.py

示例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'
        ) 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:7,代码来源:test_music_db.py

示例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") 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:5,代码来源:test_music_db.py

示例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") 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:8,代码来源:test_music_db.py

示例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'
        ) 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:7,代码来源:test_music_db.py

示例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'
        ) 
开发者ID:mopidy,项目名称:mopidy-mpd,代码行数:7,代码来源:test_music_db.py


注:本文中的mopidy.models.Album方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。