"git@developer.sourcefind.cn:change/sglang.git" did not exist on "56f5fc4ab5e1d9e270dcdab5f1d6f67e6785eebe"
Commit 6c77fdf6 authored by Ashok M's avatar Ashok M Committed by Francisco Massa
Browse files

Test - Added downloaded directory not empty check in test_datasets_utils (#844)

parent 144ca427
import os
import shutil
import tempfile
import torch
......@@ -11,12 +12,14 @@ class Tester(unittest.TestCase):
temp_dir = tempfile.mkdtemp()
url = "http://github.com/pytorch/vision/archive/master.zip"
utils.download_url(url, temp_dir)
assert not len(os.listdir(temp_dir)) == 0, 'The downloaded root directory is empty after download.'
shutil.rmtree(temp_dir)
def test_download_url_retry_http(self):
temp_dir = tempfile.mkdtemp()
url = "https://github.com/pytorch/vision/archive/master.zip"
utils.download_url(url, temp_dir)
assert not len(os.listdir(temp_dir)) == 0, 'The downloaded root directory is empty after download.'
shutil.rmtree(temp_dir)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment