-
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.
Merge pull request #93 from schireson/dc/weird-absolute-path
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from databudgie.utils import join_paths | ||
|
||
|
||
class Test_join_paths: | ||
def test_one_component(self): | ||
path = join_paths("/first") | ||
assert path == "/first" | ||
|
||
def test_first_component_absolute_path(self): | ||
path = join_paths("/first", "/2nd") | ||
assert path == "/first/2nd" | ||
|
||
def test_non_first_component_absolute_path(self): | ||
path = join_paths("first", "/2nd/") | ||
assert path == "first/2nd" | ||
|
||
def test_bad_first_component(self): | ||
path = join_paths(None, "/first") | ||
assert path == "/first" | ||
|
||
def test_no_components(self): | ||
path = join_paths(None) | ||
assert path == "" |