forked from fastapi/typer
-
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.
Use expanduser() on Path arguments/options
Fixes fastapi#252
- Loading branch information
Showing
2 changed files
with
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import pathlib | ||
|
||
from typer import main | ||
|
||
|
||
def test_param_path_convertor() -> None: | ||
assert main.param_path_convertor(None) is None | ||
assert main.param_path_convertor("/foo") == pathlib.Path("/foo") | ||
# check that expanduser has been called. | ||
# If we start to run tests on windows, we will probably need to update this | ||
assert main.param_path_convertor("~/foo").to_posix().startswith("/") |
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