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