def test_download_apequest(self, mock_stdout): download_corpus("apequest", DATA_PATH) self.assertTrue(os.path.isdir(DATA_PATH + "apequest")) self.assertIn("Download succeeded.", mock_stdout.getvalue()) download_corpus("apequest", DATA_PATH) self.assertIn("apequest is already in cache.", mock_stdout.getvalue()) shutil.rmtree(DATA_PATH + "apequest")
def download(data, model, saving_path): for d in data: download_corpus(d, saving_path) for m in model: download_model(m, saving_path)
def test_download_docwmt19(self, mock_stdout): download_corpus("doc-wmt19", DATA_PATH) self.assertTrue(os.path.isdir(DATA_PATH + "doc-wmt19")) self.assertIn("Download succeeded.", mock_stdout.getvalue()) shutil.rmtree(DATA_PATH + "doc-wmt19")
def test_download_wmt(self, mock_stdout): download_corpus("wmt-metrics", DATA_PATH) self.assertTrue(os.path.isdir(DATA_PATH + "wmt-metrics")) self.assertIn("Download succeeded.", mock_stdout.getvalue()) shutil.rmtree(DATA_PATH + "wmt-metrics")