def test_collect_all_resources(self): res = coursera_dl.find_resources_to_get(self.sample_bag, 'all', None) self.assertEqual([('mp4', 'h://url1/lc1.mp4', 'video'), ('pdf', 'h://url2/lc2.pdf', 'slides'), ('txt', 'h://url3/lc3.txt', 'subtitle')], sorted(res))
def test_collect_with_filtering(sample_bag): res = coursera_dl.find_resources_to_get(sample_bag, 'all', 'de') res = sorted(res) assert [('mp4', 'h://url1/lc1.mp4', 'video'), ('pdf', 'h://url2/lc2.pdf', 'slides')] == res
def test_collect_only_pdfs(sample_bag): res = coursera_dl.find_resources_to_get(sample_bag, 'pdf', None) assert [('pdf', 'h://url2/lc2.pdf', 'slides')] == sorted(res)
def test_collect_all_resources(sample_bag): res = coursera_dl.find_resources_to_get(sample_bag, 'all', None) assert [('mp4', 'h://url1/lc1.mp4', 'video'), ('pdf', 'h://url2/lc2.pdf', 'slides'), ('txt', 'h://url3/lc3.txt', 'subtitle')] == sorted(res)
def test_collect_only_pdfs(self): res = coursera_dl.find_resources_to_get(self.sample_bag, 'pdf', None) self.assertEqual([('pdf', 'h://url2/lc2.pdf', 'slides')], sorted(res))