HTTPError: reformat error message

This commit is contained in:
pawel
2019-11-29 15:30:55 +01:00
committed by Paweł Redzyński
parent e084b427e3
commit c102a781c2
3 changed files with 2 additions and 15 deletions
+1 -3
View File
@@ -352,6 +352,4 @@ class NoOutputInExternalRepoError(DvcException):
class HTTPError(DvcException):
def __init__(self, code, reason):
super(HTTPError, self).__init__(
"HTTP error: '{} {}'".format(code, reason)
)
super(HTTPError, self).__init__("'{} {}'".format(code, reason))
-1
View File
@@ -50,7 +50,6 @@ class RemoteHTTP(RemoteBASE):
with open(to_file, "wb") as fd:
for chunk in response.iter_content(chunk_size=self.CHUNK_SIZE):
fd.write(chunk)
fd.flush()
pbar.update(len(chunk))
def exists(self, path_info):
+1 -11
View File
@@ -1,8 +1,3 @@
try:
from http.server import BaseHTTPRequestHandler
except ImportError:
from BaseHTTPServer import BaseHTTPRequestHandler
import pytest
from dvc.config import ConfigError
@@ -24,12 +19,7 @@ def test_no_traverse_compatibility(dvc_repo):
def test_download_fails_on_error_code(dvc_repo):
class ErrorStatusRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(404, message="Not found")
self.end_headers()
with StaticFileServer(ErrorStatusRequestHandler) as httpd:
with StaticFileServer() as httpd:
url = "http://localhost:{}/".format(httpd.server_port)
config = {"url": url}