本文整理汇总了Python中spotify._mockspotify.mock_playlist函数的典型用法代码示例。如果您正苦于以下问题:Python mock_playlist函数的具体用法?Python mock_playlist怎么用?Python mock_playlist使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mock_playlist函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_sq_item_exception
def test_sq_item_exception(self):
p1 = _mockspotify.mock_playlist("foo", [])
p2 = _mockspotify.mock_playlist("bar", [])
pc = _mockspotify.mock_playlistcontainer([p1, p2])
def _():
return pc[2]
self.assertRaises(IndexError, _)
开发者ID:JoeConyers,项目名称:SpotifyRemote,代码行数:7,代码来源:test_playlist.py
示例2: test_add_tracks_wrong_position
def test_add_tracks_wrong_position(self):
p1 = self._mock_track("foo")
p2 = self._mock_track("bar")
pl = mock_playlist("foobar", [p1])
pl.add_tracks(99, [p2])
开发者ID:klette,项目名称:pyspotify,代码行数:5,代码来源:test_playlist.py
示例3: test_len
def test_len(self):
playlist = mock_playlist(u"foo", self.tracks, self.owner)
self.assertEqual(len(playlist), 3)
开发者ID:joseulisesmena,项目名称:technic,代码行数:3,代码来源:test_playlist.py
示例4: test_rename_unicode
def test_rename_unicode(self):
playlist = mock_playlist(u"foo", [], self.owner)
playlist.rename(u"bąr")
self.assertEqual(playlist.name(), u"bąr")
开发者ID:joseulisesmena,项目名称:technic,代码行数:4,代码来源:test_playlist.py
示例5: test_name
def test_name(self):
playlist = mock_playlist("playlist", [], self.owner)
self.assertEqual(playlist.name(), "playlist")
开发者ID:joseulisesmena,项目名称:technic,代码行数:3,代码来源:test_playlist.py
示例6: test_track_create_time
def test_track_create_time(self):
playlist = mock_playlist("foo", self.tracks, self.owner)
self.assertEqual(playlist.track_create_time(0), 1320961109)
开发者ID:joseulisesmena,项目名称:technic,代码行数:3,代码来源:test_playlist.py
示例7: test_add_tracks_wrong_position
def test_add_tracks_wrong_position(self):
playlist = mock_playlist("foo", [], self.owner)
playlist.add_tracks(99, self.pure_tracks)
开发者ID:joseulisesmena,项目名称:technic,代码行数:3,代码来源:test_playlist.py
示例8: test_subscribers
def test_subscribers(self):
playlist = mock_playlist(u"foo", [], self.owner, subscribers=["foo", "bar", "baz"])
self.assertEqual(playlist.subscribers(), [u"foo", u"bar", u"baz"])
开发者ID:joseulisesmena,项目名称:technic,代码行数:3,代码来源:test_playlist.py
示例9: test_rename_too_long
def test_rename_too_long(self):
p1 = _mockspotify.mock_playlist(u"foo", [])
p1.rename(u"bar" * 100)
开发者ID:klette,项目名称:pyspotify,代码行数:3,代码来源:test_playlist.py
示例10: test_rename_unicode
def test_rename_unicode(self):
p1 = _mockspotify.mock_playlist(u"foo", [])
p1.rename(u"bąr")
self.assertEqual(p1.name(), u"bąr")
开发者ID:klette,项目名称:pyspotify,代码行数:4,代码来源:test_playlist.py
示例11: test_name_unicode
def test_name_unicode(self):
p1 = _mockspotify.mock_playlist(u"æâ€êþÿ", [])
self.assertEqual(p1.name(), u"æâ€êþÿ")
开发者ID:klette,项目名称:pyspotify,代码行数:3,代码来源:test_playlist.py
示例12: test_name
def test_name(self):
p1 = _mockspotify.mock_playlist("foo", [])
self.assertEqual(p1.name(), "foo")
开发者ID:klette,项目名称:pyspotify,代码行数:3,代码来源:test_playlist.py
示例13: test_sq_item
def test_sq_item(self):
p1 = _mockspotify.mock_playlist("foo", [])
p2 = _mockspotify.mock_playlist("bar", [])
pc = _mockspotify.mock_playlistcontainer([p1, p2])
self.assertEqual(pc[0].name(), "foo")
self.assertEqual(pc[1].name(), "bar")
开发者ID:klette,项目名称:pyspotify,代码行数:6,代码来源:test_playlist.py
示例14: test_track_create_time
def test_track_create_time(self):
p1 = self._mock_track("foo")
pl = mock_playlist("foobar", [p1])
self.assertEqual(pl.track_create_time(0), 1320961109)
开发者ID:klette,项目名称:pyspotify,代码行数:4,代码来源:test_playlist.py
示例15: test_add_tracks_wrong_types
def test_add_tracks_wrong_types(self):
p1 = self._mock_track("foo")
pl = mock_playlist("foobar", [p1])
self.assertRaises(TypeError, pl.add_tracks, 0, True)
self.assertRaises(TypeError, pl.add_tracks, [False])
开发者ID:klette,项目名称:pyspotify,代码行数:5,代码来源:test_playlist.py
示例16: test_rename_too_long
def test_rename_too_long(self):
playlist = mock_playlist(u'foo', [], self.owner)
playlist.rename(u'bar' * 100)
开发者ID:kingosticks,项目名称:pyspotify,代码行数:3,代码来源:test_playlist.py
示例17: test_num_subscribers
def test_num_subscribers(self):
playlist = mock_playlist("foo", [], self.owner, num_subscribers=42)
self.assertEqual(playlist.num_subscribers(), 42)
开发者ID:joseulisesmena,项目名称:technic,代码行数:3,代码来源:test_playlist.py
示例18: test_len
def test_len(self):
p1 = self._mock_track("foo")
p2 = self._mock_track("bar")
pc = _mockspotify.mock_playlist("foobar", [p1, p2])
self.assertEqual(len(pc), 2)
开发者ID:klette,项目名称:pyspotify,代码行数:5,代码来源:test_playlist.py
示例19: test_add_tracks_ok
def test_add_tracks_ok(self):
playlist = mock_playlist(u"foo", [], self.owner)
playlist.add_tracks(0, self.pure_tracks)
开发者ID:joseulisesmena,项目名称:technic,代码行数:3,代码来源:test_playlist.py
示例20: test_add_tracks_wrong_types
def test_add_tracks_wrong_types(self):
playlist = mock_playlist("foo", [], self.owner)
self.assertRaises(TypeError, playlist.add_tracks, 0, True)
self.assertRaises(TypeError, playlist.add_tracks, [False])
开发者ID:joseulisesmena,项目名称:technic,代码行数:4,代码来源:test_playlist.py
注:本文中的spotify._mockspotify.mock_playlist函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论