Example #1
0
    def test_sq_item_exception(self):
        pc = mock_playlistcontainer(self.owner, [self.p1, self.p2])

        def _():
            return pc[2]

        self.assertRaises(IndexError, _)
 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 #3
0
    def test_sq_item_exception(self):
        pc = mock_playlistcontainer(self.owner, [self.p1, self.p2])

        def _():
            return pc[2]

        self.assertRaises(IndexError, _)
Example #4
0
    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 #5
0
 def test_playlistfolder(self):
     p1 = mock_playlistfolder("folder_start", "foo", folder_id=42)
     p2 = mock_playlistfolder("folder_end", "")
     pc = mock_playlistcontainer(self.owner, [p1, p2])
     f1, f2 = pc[0], pc[1]
     self.assertEqual(f1.name(), u"foo")
     self.assertEqual(f1.type(), "folder_start")
     self.assertEqual(f2.type(), "folder_end")
     self.assertEqual(f1.id(), 42)
     self.assertTrue(f1.is_loaded())
Example #6
0
 def test_playlistfolder(self):
     p1 = _mockspotify.mock_playlistfolder("folder_start", "foo")
     p2 = _mockspotify.mock_playlistfolder("folder_end", "")
     pc = _mockspotify.mock_playlistcontainer([p1, p2])
     f1, f2 = pc[0], pc[1]
     self.assertEqual(f1.name(), u'foo')
     self.assertEqual(f1.type(), 'folder_start')
     self.assertEqual(f2.type(), 'folder_end')
     self.assertEqual(f1.id(), 42)
     self.assertTrue(f1.is_loaded())
Example #7
0
 def test_playlistfolder(self):
     p1 = _mockspotify.mock_playlistfolder("folder_start", "foo")
     p2 = _mockspotify.mock_playlistfolder("folder_end", "")
     pc = _mockspotify.mock_playlistcontainer([p1, p2])
     f1,f2  = pc[0],pc[1]
     self.assertEqual(f1.name(), u'foo')
     self.assertEqual(f1.type(), 'folder_start')
     self.assertEqual(f2.type(), 'folder_end')
     self.assertEqual(f1.id(), 42)
     self.assertTrue(f1.is_loaded())
Example #8
0
 def test_sq_item(self):
     pc = mock_playlistcontainer(self.owner, [self.p1, self.p2])
     self.assertEqual(pc[0].name(), "foo")
     self.assertEqual(pc[1].name(), "bar")
Example #9
0
 def test_len(self):
     pc = mock_playlistcontainer(self.owner, [self.p1, self.p2])
     self.assertEqual(len(pc), 2)
Example #10
0
 def test_remove_playlist_out_of_range(self):
     pc = mock_playlistcontainer(self.owner, [])        
     self.assertRaises(IndexError, pc.remove_playlist, 0)
Example #11
0
 def test_remove_playlist(self):
     pc = mock_playlistcontainer(self.owner, [self.p1, self.p2])
     pc.remove_playlist(1)
     self.assertEqual(len(pc), 1)
Example #12
0
 def test_sq_item(self):
     pc = mock_playlistcontainer(self.owner, [self.p1, self.p2])
     self.assertEqual(pc[0].name(), "foo")
     self.assertEqual(pc[1].name(), "bar")
Example #13
0
 def test_len(self):
     p1 = _mockspotify.mock_playlist("foo", [])
     p2 = _mockspotify.mock_playlist("bar", [])
     pc = _mockspotify.mock_playlistcontainer([p1, p2])
     self.assertEqual(len(pc), 2)
Example #14
0
 def test_add_new_playlist(self):
     pc = mock_playlistcontainer(self.owner, [])
     pc.add_new_playlist("foo")
     self.assertRaises(ValueError, pc.add_new_playlist, "foo" * 100)
 def setUp(self):
     self.manager = MyContainerManager()
     self.playlist = mock_playlist('foo_', [])
     self.container = mock_playlistcontainer([])
 def setUp(self):
     self.manager = MyContainerManager()
     self.playlist = mock_playlist('foo_', [])
     self.container = mock_playlistcontainer([])
Example #17
0
 def test_remove_playlist_out_of_range(self):
     pc = mock_playlistcontainer(self.owner, [])
     self.assertRaises(IndexError, pc.remove_playlist, 0)
Example #18
0
 def test_remove_playlist(self):
     pc = mock_playlistcontainer(self.owner, [self.p1, self.p2])
     pc.remove_playlist(1)
     self.assertEqual(len(pc), 1)
Example #19
0
 def test_add_new_playlist(self):
     pc = mock_playlistcontainer(self.owner, [])
     pc.add_new_playlist('foo')
     self.assertRaises(ValueError, pc.add_new_playlist, 'foo' * 100)
Example #20
0
 def test_add_new_playlist(self):
     pc = _mockspotify.mock_playlistcontainer([])
     pc.add_new_playlist('foo');
     pc.add_new_playlist(u'bȧr');
     self.assertRaises(ValueError, pc.add_new_playlist, 'foo' * 100)
Example #21
0
 def test_len(self):
     p1 = _mockspotify.mock_playlist("foo", [])
     p2 = _mockspotify.mock_playlist("bar", [])
     pc = _mockspotify.mock_playlistcontainer([p1, p2])
     self.assertEqual(len(pc), 2)
Example #22
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 #23
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 #24
0
 def test_add_new_playlist(self):
     pc = _mockspotify.mock_playlistcontainer([])
     pc.add_new_playlist('foo')
     pc.add_new_playlist(u'bȧr')
     self.assertRaises(ValueError, pc.add_new_playlist, 'foo' * 100)
Example #25
0
 def test_add_new_playlist(self):
     pc = _mockspotify.mock_playlistcontainer([])
     pc.add_new_playlist("foo")
     pc.add_new_playlist(u"bȧr")
     self.assertRaises(ValueError, pc.add_new_playlist, "foo" * 100)
Example #26
0
 def setUp(self):
     self.manager = MyContainerManager()
     self.container = mock_playlistcontainer(mock_user('user'), [])
Example #27
0
 def test_len(self):
     pc = mock_playlistcontainer(self.owner, [self.p1, self.p2])
     self.assertEqual(len(pc), 2)