def test_download_content_no_length(self): with tempfile.SpooledTemporaryFile() as f: download(mock_url, f) f.seek(0) assert_equal(f.read(), mock_content)
def test_download_content(self): with tempfile.SpooledTemporaryFile() as f: download(iris_url, f) f.seek(0) assert_equal(hashlib.md5(f.read()).hexdigest(), iris_hash)
def test_download(): f = tempfile.SpooledTemporaryFile() download(iris_url, f) f.seek(0) assert hashlib.md5(f.read()).hexdigest() == iris_hash f.close()