forked from iterative/dvc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
import-url: allow queries in URL (iterative#3432)
* import-url: allow queries in URL Fixes iterative#3424 * Revert "import-url: allow queries in URL" This reverts commit 48495d0. * path_info: add HTTPURLInfo base * path_info: HTTPURLInfo complete * remote: http(s): support params, queries, fragments Fixes iterative#3424 Closes iterative#3432 * tests: path_info: HTTPURLInfo * lint * tests: path_info: HTTPURLInfo Slightly more thorough testing
- Loading branch information
Showing
3 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
import pytest | ||
|
||
from dvc.path_info import CloudURLInfo | ||
from dvc.path_info import HTTPURLInfo | ||
from dvc.path_info import PathInfo | ||
from dvc.path_info import URLInfo | ||
|
||
|
@@ -44,13 +45,23 @@ def test_url_info_parents(cls): | |
] | ||
|
||
|
||
@pytest.mark.parametrize("cls", [URLInfo, CloudURLInfo]) | ||
@pytest.mark.parametrize("cls", [URLInfo, CloudURLInfo, HTTPURLInfo]) | ||
def test_url_info_deepcopy(cls): | ||
u1 = cls("ssh://[email protected]:/test1/test2/test3") | ||
u2 = copy.deepcopy(u1) | ||
assert u1 == u2 | ||
|
||
|
||
def test_https_url_info_str(): | ||
url = "https://[email protected]/test1;p=par?q=quer#frag" | ||
u = HTTPURLInfo(url) | ||
assert u.url == url | ||
assert str(u) == u.url | ||
assert u.params == "p=par" | ||
assert u.query == "q=quer" | ||
assert u.fragment == "frag" | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"path, as_posix, osname", | ||
[ | ||
|