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

        def _():
            return pc[2]

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

        def _():
            return pc[2]

        self.assertRaises(IndexError, _)
示例#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, _)
示例#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())
示例#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())
示例#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())
示例#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")
示例#9
0
 def test_len(self):
     pc = mock_playlistcontainer(self.owner, [self.p1, self.p2])
     self.assertEqual(len(pc), 2)
示例#10
0
 def test_remove_playlist_out_of_range(self):
     pc = mock_playlistcontainer(self.owner, [])        
     self.assertRaises(IndexError, pc.remove_playlist, 0)
示例#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)
示例#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")
示例#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)
示例#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([])
示例#17
0
 def test_remove_playlist_out_of_range(self):
     pc = mock_playlistcontainer(self.owner, [])
     self.assertRaises(IndexError, pc.remove_playlist, 0)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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")
示例#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")
示例#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)
示例#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)
示例#26
0
 def setUp(self):
     self.manager = MyContainerManager()
     self.container = mock_playlistcontainer(mock_user('user'), [])
示例#27
0
 def test_len(self):
     pc = mock_playlistcontainer(self.owner, [self.p1, self.p2])
     self.assertEqual(len(pc), 2)