diff --git a/tests/test_dlist.py b/tests/test_dlist.py index 884b69a..4992f80 100644 --- a/tests/test_dlist.py +++ b/tests/test_dlist.py @@ -118,11 +118,11 @@ class TestMoveUp(unittest.TestCase): self.dlist = DownloadList(mocks) def test_move_up(self): - self.dlist.move_up(1) + self.assertTrue(self.dlist.move_up(1)) self.assertEqual(self.dlist._items_list, [1, 0, 2]) def test_move_up_already_on_top(self): - self.dlist.move_up(0) + self.assertFalse(self.dlist.move_up(0)) self.assertEqual(self.dlist._items_list, [0, 1, 2]) def test_move_up_not_exist(self): @@ -138,11 +138,11 @@ class TestMoveDown(unittest.TestCase): self.dlist = DownloadList(mocks) def test_move_down(self): - self.dlist.move_down(1) + self.assertTrue(self.dlist.move_down(1)) self.assertEqual(self.dlist._items_list, [0, 2, 1]) def test_move_down_already_on_bottom(self): - self.dlist.move_down(2) + self.assertFalse(self.dlist.move_down(2)) self.assertEqual(self.dlist._items_list, [0, 1, 2]) def test_move_down_not_exist(self): diff --git a/youtube_dl_gui/downloadmanager.py b/youtube_dl_gui/downloadmanager.py index c1112f9..090ae31 100644 --- a/youtube_dl_gui/downloadmanager.py +++ b/youtube_dl_gui/downloadmanager.py @@ -235,6 +235,9 @@ class DownloadList(object): if index > 0: self._swap(index, index - 1) + return True + + return False @synchronized(_SYNC_LOCK) def move_down(self, object_id): @@ -243,6 +246,9 @@ class DownloadList(object): if index < (len(self._items_list) - 1): self._swap(index, index + 1) + return True + + return False @synchronized(_SYNC_LOCK) def get_item(self, object_id):