-
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.
Convert all paths in config to posix-style (#3665)
* Convert all paths in config to posix-style * Use PathInfo for consistancy, add unit test and change functional tests * Exclude Windows test on Linux * Don't patch Config for all the tests! * Don't do the linux test on Windows either * De-hackify the unit test, make the functional test more explicit * tests: adjust tests Co-authored-by: Charles Baynham <[email protected]> Co-authored-by: Ruslan Kuprieiev <[email protected]>
- Loading branch information
1 parent
a2de48b
commit a8b7e33
Showing
4 changed files
with
49 additions
and
17 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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
import pytest | ||
|
||
from dvc.config import Config | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"path, expected", | ||
[ | ||
("cache", "../cache"), | ||
(os.path.join("..", "cache"), "../../cache"), | ||
(os.getcwd(), os.getcwd().replace("\\", "/")), | ||
("ssh://some/path", "ssh://some/path"), | ||
], | ||
) | ||
def test_to_relpath(path, expected): | ||
assert Config._to_relpath(os.path.join(".", "config"), path) == expected |