From a620658884ecc67113d6e86a3641ffe0c2e723e8 Mon Sep 17 00:00:00 2001 From: pawel Date: Mon, 6 Jan 2020 16:18:01 +0100 Subject: [PATCH 1/2] http/ imp tests - migrate do dir helpers --- tests/unit/command/test_imp.py | 2 +- tests/unit/command/test_imp_url.py | 4 ++-- tests/unit/remote/test_http.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/unit/command/test_imp.py b/tests/unit/command/test_imp.py index 5775849f1f..e5fee4de15 100644 --- a/tests/unit/command/test_imp.py +++ b/tests/unit/command/test_imp.py @@ -2,7 +2,7 @@ from dvc.command.imp import CmdImport -def test_import(mocker, dvc_repo): +def test_import(mocker, dvc): cli_args = parse_args( ["import", "repo_url", "src", "--out", "out", "--rev", "version"] ) diff --git a/tests/unit/command/test_imp_url.py b/tests/unit/command/test_imp_url.py index 8858188f6d..2ce69dfab7 100644 --- a/tests/unit/command/test_imp_url.py +++ b/tests/unit/command/test_imp_url.py @@ -5,7 +5,7 @@ from dvc.exceptions import DvcException -def test_import_url(mocker, dvc_repo): +def test_import_url(mocker, dvc): 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, dvc): cli_args = parse_args(["import-url", "http://somesite.com/file_name"]) assert cli_args.func == CmdImportUrl diff --git a/tests/unit/remote/test_http.py b/tests/unit/remote/test_http.py index dbd54bcd15..20c8854fce 100644 --- a/tests/unit/remote/test_http.py +++ b/tests/unit/remote/test_http.py @@ -7,7 +7,7 @@ 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") From e1176bf42dc654da37d63087fd9f745d11f2f2fc Mon Sep 17 00:00:00 2001 From: pawel Date: Mon, 6 Jan 2020 16:40:15 +0100 Subject: [PATCH 2/2] imp/imp_url cmd test: remove unnecessary dvc fixture --- tests/unit/command/test_imp.py | 2 +- tests/unit/command/test_imp_url.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/command/test_imp.py b/tests/unit/command/test_imp.py index e5fee4de15..f149ee5dcc 100644 --- a/tests/unit/command/test_imp.py +++ b/tests/unit/command/test_imp.py @@ -2,7 +2,7 @@ from dvc.command.imp import CmdImport -def test_import(mocker, dvc): +def test_import(mocker): cli_args = parse_args( ["import", "repo_url", "src", "--out", "out", "--rev", "version"] ) diff --git a/tests/unit/command/test_imp_url.py b/tests/unit/command/test_imp_url.py index 2ce69dfab7..df8e20ee99 100644 --- a/tests/unit/command/test_imp_url.py +++ b/tests/unit/command/test_imp_url.py @@ -5,7 +5,7 @@ from dvc.exceptions import DvcException -def test_import_url(mocker, dvc): +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): m.assert_called_once_with("src", out="out", fname="file") -def test_failed_import_url(mocker, caplog, dvc): +def test_failed_import_url(mocker, caplog): cli_args = parse_args(["import-url", "http://somesite.com/file_name"]) assert cli_args.func == CmdImportUrl