本文整理汇总了Python中spotify._mockspotify.mock_playlist函数的典型用法代码示例。如果您正苦于以下问题:Python mock_playlist函数的具体用法?Python mock_playlist怎么用?Python mock_playlist使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mock_playlist函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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, _)
示例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])
示例3: test_len
def test_len(self):
playlist = mock_playlist(u"foo", self.tracks, self.owner)
self.assertEqual(len(playlist), 3)
示例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")
示例5: test_name
def test_name(self):
playlist = mock_playlist("playlist", [], self.owner)
self.assertEqual(playlist.name(), "playlist")
示例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)
示例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)
示例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"])
示例9: test_rename_too_long
def test_rename_too_long(self):
p1 = _mockspotify.mock_playlist(u"foo", [])
p1.rename(u"bar" * 100)
示例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")
示例11: test_name_unicode
def test_name_unicode(self):
p1 = _mockspotify.mock_playlist(u"æâ€êþÿ", [])
self.assertEqual(p1.name(), u"æâ€êþÿ")
示例12: test_name
def test_name(self):
p1 = _mockspotify.mock_playlist("foo", [])
self.assertEqual(p1.name(), "foo")
示例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")
示例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)
示例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])