-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dvc: override replace in HTTPURLInfo to include extra_parts (#4517)
* dvc: override replace in HTTPURLInfo to include extra_parts The objective is to passtrough any parameter configured in http remotes. fixes #4508 * add unit test for #4508 * Use HTTPURLInfo directly instead of decorator
- Loading branch information
1 parent
1f495d6
commit 79e8e4e
Showing
2 changed files
with
26 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,3 +85,20 @@ def test_https_url_info_str(): | |
def test_path_info_as_posix(mocker, path, as_posix, osname): | ||
mocker.patch("os.name", osname) | ||
assert PathInfo(path).as_posix() == as_posix | ||
|
||
|
||
def test_url_replace_path(): | ||
url = "https://[email protected]/original/path;p=par?q=quer#frag" | ||
|
||
u = HTTPURLInfo(url) | ||
new_u = u.replace("/new/path") | ||
|
||
assert u.path == "/original/path" | ||
assert new_u.path == "/new/path" | ||
|
||
assert u.scheme == new_u.scheme | ||
assert u.host == new_u.host | ||
assert u.user == new_u.user | ||
assert u.params == new_u.params | ||
assert u.query == new_u.query | ||
assert u.fragment == new_u.fragment |