import unittest
import os
import time
import uuid
import tempfile
from ..http import download


class TestUtilsHttp(unittest.TestCase):

    def test_download(self):
        folder = tempfile.gettempdir()
        path = os.path.join(folder, str(uuid.uuid4()))
        fsize = download("http://www.baidu.com", path)
        os.unlink(path)
        assert fsize > 0
