Merge pull request #3070 from pared/2896_http_imp

http/ imp tests - migrate do dir helpers
This commit is contained in:
Ruslan Kuprieiev
2020-01-06 20:38:37 +02:00
committed by GitHub
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ from dvc.cli import parse_args
from dvc.command.imp import CmdImport
def test_import(mocker, dvc_repo):
def test_import(mocker):
cli_args = parse_args(
["import", "repo_url", "src", "--out", "out", "--rev", "version"]
)
+2 -2
View File
@@ -5,7 +5,7 @@ from dvc.command.imp_url import CmdImportUrl
from dvc.exceptions import DvcException
def test_import_url(mocker, dvc_repo):
def test_import_url(mocker):
cli_args = parse_args(["import-url", "src", "out", "--file", "file"])
assert cli_args.func == CmdImportUrl
@@ -17,7 +17,7 @@ def test_import_url(mocker, dvc_repo):
m.assert_called_once_with("src", out="out", fname="file")
def test_failed_import_url(mocker, caplog, dvc_repo):
def test_failed_import_url(mocker, caplog):
cli_args = parse_args(["import-url", "http://somesite.com/file_name"])
assert cli_args.func == CmdImportUrl
+4 -4
View File
@@ -7,7 +7,7 @@ from dvc.remote.http import RemoteHTTP
from tests.utils.httpd import StaticFileServer
def test_no_traverse_compatibility(dvc_repo):
def test_no_traverse_compatibility(dvc):
config = {
"url": "http://example.com/",
"path_info": "file.html",
@@ -15,15 +15,15 @@ def test_no_traverse_compatibility(dvc_repo):
}
with pytest.raises(ConfigError):
RemoteHTTP(dvc_repo, config)
RemoteHTTP(dvc, config)
def test_download_fails_on_error_code(dvc_repo):
def test_download_fails_on_error_code(dvc):
with StaticFileServer() as httpd:
url = "http://localhost:{}/".format(httpd.server_port)
config = {"url": url}
remote = RemoteHTTP(dvc_repo, config)
remote = RemoteHTTP(dvc, config)
with pytest.raises(HTTPError):
remote._download(URLInfo(url) / "missing.txt", "missing.txt")