本文整理汇总了Python中YouTubeStorage.YouTubeStorage.getStoredArtists方法的典型用法代码示例。如果您正苦于以下问题:Python YouTubeStorage.getStoredArtists方法的具体用法?Python YouTubeStorage.getStoredArtists怎么用?Python YouTubeStorage.getStoredArtists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YouTubeStorage.YouTubeStorage
的用法示例。
在下文中一共展示了YouTubeStorage.getStoredArtists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_getStoredArtists_should_call_retrieve_to_get_list_of_artists
# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getStoredArtists [as 别名]
def test_getStoredArtists_should_call_retrieve_to_get_list_of_artists(self):
storage = YouTubeStorage()
storage.retrieve = Mock()
storage.retrieve.return_value = []
# storage.retrieve.return_value = [("some_title", "some_artist")]
storage.getStoredArtists({"store": "somestore"})
storage.retrieve.assert_called_with({"store": "somestore"})
示例2: test_list_should_call_getStoredArtists_if_store_artist_is_in_params
# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getStoredArtists [as 别名]
def test_list_should_call_getStoredArtists_if_store_artist_is_in_params(self):
storage = YouTubeStorage()
storage.getStoredArtists = Mock()
storage.getStoredArtists.return_value = ("", 200)
storage.list({"store": "artists"})
storage.getStoredArtists.assert_called_with({"store": "artists"})
示例3: test_getStoredArtists_should_call_retrieve_to_get_artist_thumbnails
# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getStoredArtists [as 别名]
def test_getStoredArtists_should_call_retrieve_to_get_artist_thumbnails(self):
storage = YouTubeStorage()
storage.retrieve = Mock()
storage.retrieve.return_value = [("some_title", "some_artist")]
storage.getStoredArtists({"path": "some_path", "store": "somestore"})
storage.retrieve.assert_called_with(
{"path": "some_path", "store": "somestore"},
"thumbnail",
{
"artist": "some_artist",
"Title": "some_title",
"scraper": "music_artist",
"path": "some_path",
"thumbnail": [("some_title", "some_artist")],
"icon": "music",
},
)
示例4: test_getStoredArtists_should_return_proper_list_structure
# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getStoredArtists [as 别名]
def test_getStoredArtists_should_return_proper_list_structure(self):
storage = YouTubeStorage()
storage.retrieve = Mock()
storage.retrieve.return_value = [("some_title", "some_artist")]
(result, status) = storage.getStoredArtists({"path": "some_path", "store": "somestore"})
assert result[0]["artist"] == "some_artist"
assert result[0]["Title"] == "some_title"
assert result[0]["scraper"] == "music_artist"
assert result[0].has_key("icon")
assert result[0].has_key("thumbnail")