def test_download_attachments(self): real_file = os.path.join(CUR_DIR, 'content/article.rst') good_url = path_to_file_url(real_file) bad_url = 'http://localhost:1/not_a_file.txt' silent_da = mute()(download_attachments) with temporary_folder() as temp: locations = list(silent_da(temp, [good_url, bad_url])) self.assertEqual(1, len(locations)) directory = locations[0] self.assertTrue(directory.endswith(os.path.join('content', 'article.rst')), directory)
def test_download_attachments(self): real_file = os.path.join(CUR_DIR, 'content/article.rst') good_url = path_to_file_url(real_file) bad_url = 'http://localhost:1/not_a_file.txt' silent_da = mute()(download_attachments) with temporary_folder() as temp: locations = list(silent_da(temp, [good_url, bad_url])) self.assertEqual(1, len(locations)) directory = locations[0] self.assertTrue( directory.endswith(posix_join('content', 'article.rst')), directory)