-
-
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.
fix: Add error-handling if configuration file is not exists.
- Currently, 'info' command only - Change pipe for Error type
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 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,14 @@ | ||
"""Test case for ``age info``.""" | ||
|
||
from pathlib import Path | ||
from subprocess import PIPE, run | ||
|
||
|
||
def test_not_configured_env(target_bin: str, tmp_path: Path): | ||
"""'info' command requires configuration file. | ||
If age does not find configuration file, it should display message. | ||
""" | ||
proc = run([target_bin, "info"], stdout=PIPE, stderr=PIPE, text=True, cwd=tmp_path) | ||
assert proc.returncode == 1 | ||
assert "not exists." in proc.stderr |