mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 23:10:42 +01:00
HTTPError: reformat error message
This commit is contained in:
+1
-3
@@ -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))
|
||||
|
||||
@@ -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,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}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user