diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-09-29 00:36:06 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-09-29 00:36:06 +0200 |
commit | 9c44d2429b90dece734df778c63b04c15e91c1ca (patch) | |
tree | 8ab92c7d2e6e9ca62d261a42385332462ba08949 /test/test_utils.py | |
parent | d2e32f7df56ab497175437bffdcdfedbd71ca8d9 (diff) |
[vimeo:likes] Support large like lists (Fixes #3847)
Diffstat (limited to 'test/test_utils.py')
-rw-r--r-- | test/test_utils.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index 3efbed29d..6419b3ca9 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -22,7 +22,8 @@ from youtube_dl.utils import ( fix_xml_ampersands, get_meta_content, orderedSet, - PagedList, + OnDemandPagedList, + InAdvancePagedList, parse_duration, read_batch_urls, sanitize_filename, @@ -246,10 +247,14 @@ class TestUtil(unittest.TestCase): for i in range(firstid, upto): yield i - pl = PagedList(get_page, pagesize) + pl = OnDemandPagedList(get_page, pagesize) got = pl.getslice(*sliceargs) self.assertEqual(got, expected) + iapl = InAdvancePagedList(get_page, size // pagesize + 1, pagesize) + got = iapl.getslice(*sliceargs) + self.assertEqual(got, expected) + testPL(5, 2, (), [0, 1, 2, 3, 4]) testPL(5, 2, (1,), [1, 2, 3, 4]) testPL(5, 2, (2,), [2, 3, 4]) |