-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Install cli extra normally, and add entrypoint tests.
Signed-off-by: DanCardin <[email protected]>
- Loading branch information
Showing
4 changed files
with
40 additions
and
50 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,24 @@ | ||
from unittest.mock import patch | ||
|
||
import cappa | ||
import pytest | ||
|
||
from hera.__main__ import main | ||
|
||
|
||
def test_main_dependency_missing(): | ||
with patch("importlib.util.find_spec", side_effect=ImportError): | ||
with pytest.raises(ImportError) as e: | ||
main() | ||
|
||
assert "pip install hera[cli]" in str(e.value) | ||
|
||
|
||
def test_main_dependency_exists(capsys): | ||
with pytest.raises(cappa.Exit) as e: | ||
main(["--help"]) | ||
|
||
assert e.value.code == 0 | ||
|
||
err = capsys.readouterr().err | ||
assert "CLI is a work-in-progress" in err |