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, _)
Example #2
0
 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])
Example #3
0
 def test_len(self):
     playlist = mock_playlist(u"foo", self.tracks, self.owner)
     self.assertEqual(len(playlist), 3)
Example #4
0
 def test_rename_unicode(self):
     playlist = mock_playlist(u"foo", [], self.owner)
     playlist.rename(u"bąr")
     self.assertEqual(playlist.name(), u"bąr")
Example #5
0
 def test_name(self):
     playlist = mock_playlist("playlist", [], self.owner)
     self.assertEqual(playlist.name(), "playlist")
Example #6
0
 def test_track_create_time(self):
     playlist = mock_playlist("foo", self.tracks, self.owner)
     self.assertEqual(playlist.track_create_time(0), 1320961109)
Example #7
0
 def test_add_tracks_wrong_position(self):
     playlist = mock_playlist("foo", [], self.owner)
     playlist.add_tracks(99, self.pure_tracks)
Example #8
0
 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"])
Example #9
0
 def test_rename_too_long(self):
     p1 = _mockspotify.mock_playlist(u"foo", [])
     p1.rename(u"bar" * 100)
Example #10
0
 def test_rename_unicode(self):
     p1 = _mockspotify.mock_playlist(u"foo", [])
     p1.rename(u"bąr")
     self.assertEqual(p1.name(), u"bąr")
Example #11
0
 def test_name_unicode(self):
     p1 = _mockspotify.mock_playlist(u"æâ€êþÿ", [])
     self.assertEqual(p1.name(), u"æâ€êþÿ")
Example #12
0
 def test_name(self):
     p1 = _mockspotify.mock_playlist("foo", [])
     self.assertEqual(p1.name(), "foo")
Example #13
0
 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")
Example #14
0
 def test_track_create_time(self):
     p1 = self._mock_track("foo")
     pl = mock_playlist("foobar", [p1])
     self.assertEqual(pl.track_create_time(0), 1320961109)
Example #15
0
 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])
Example #16
0
 def test_rename_too_long(self):
     playlist = mock_playlist(u'foo', [], self.owner)
     playlist.rename(u'bar' * 100)
Example #17
0
 def test_num_subscribers(self):
     playlist = mock_playlist("foo", [], self.owner, num_subscribers=42)
     self.assertEqual(playlist.num_subscribers(), 42)
Example #18
0
 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)
Example #19
0
 def test_add_tracks_ok(self):
     playlist = mock_playlist(u"foo", [], self.owner)
     playlist.add_tracks(0, self.pure_tracks)
Example #20
0
 def test_sq_item(self):
     p1 = self._mock_track("foo")
     p2 = self._mock_track("bar")
     pc = _mockspotify.mock_playlist("foobar", [p1, p2])
     self.assertEqual(pc[0].name(), "foo")
     self.assertEqual(pc[1].name(), "bar")
Example #21
0
 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])
Example #22
0
 def test_from_playlist(self):
     p = mock_playlist("foo", [])
     l = Link.from_playlist(p)
     self.assertEqual(str(l), "link:playlist:foo")
Example #23
0
 def test_owner(self):
     playlist = mock_playlist("foo", [], self.owner)
     self.assertEqual(playlist.owner().canonical_name(), self.owner.canonical_name())
Example #24
0
 def test_sq_item(self):
     playlist = mock_playlist(u'foo', self.tracks, self.owner)
     self.assertEqual(playlist[0].name(), 'track1')
     self.assertEqual(playlist[1].name(), 'track2')
     self.assertEqual(playlist[2].name(), 'track3')
Example #25
0
 def test_name_unicode(self):
     playlist = mock_playlist(u"plåylïst", [], self.owner)
     self.assertEqual(playlist.name(), u"plåylïst")
Example #26
0
 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'])
Example #27
0
 def test_rename_too_long(self):
     playlist = mock_playlist(u"foo", [], self.owner)
     playlist.rename(u"bar" * 100)
Example #28
0
 def test_name(self):
     playlist = mock_playlist('playlist', [], self.owner)
     self.assertEqual(playlist.name(), 'playlist')
Example #29
0
 def test_sq_item(self):
     playlist = mock_playlist(u"foo", self.tracks, self.owner)
     self.assertEqual(playlist[0].name(), "track1")
     self.assertEqual(playlist[1].name(), "track2")
     self.assertEqual(playlist[2].name(), "track3")
Example #30
0
 def test_rename_unicode(self):
     playlist = mock_playlist(u'foo', [], self.owner)
     playlist.rename(u'bąr')
     self.assertEqual(playlist.name(), u'bąr')