def test_process_only_from(self): download_queue, used_folders = manager.process_submissions(test_submissions, ".", True, True, ["testsubreddit"]) # All must have passed again, all submissions are from correct subreddit for url, folder, title in download_queue: self.assertTrue(url in original_urls) self.assertEqual(len(download_queue), len(test_submissions))
def test_process_nowhere(self): download_queue, used_folders = manager.process_submissions(test_submissions, ".", True, True, ["nowhere"]) # None should pass, all are from wrong subreddit self.assertEqual(len(download_queue), 0)
def test_process_all(self): download_queue, used_folders = manager.process_submissions(test_submissions, ".", True, True, []) # Checking for only_from, ensure that none got filtered for url, folder, title in download_queue: self.assertTrue(url in original_urls) self.assertEqual(len(download_queue), len(test_submissions))