Пример #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([])
Пример #16
0
 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)