-
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.
- Loading branch information
1 parent
693e8ec
commit 6f7761f
Showing
1 changed file
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""Tests for the Command-line interface.""" | ||
|
||
|
||
def test_cli_version(script_runner): | ||
from .. import __version__ | ||
|
||
result = script_runner.run(["iact-estimator", "--version"]) | ||
assert result.returncode == 0 | ||
assert result.stderr == f"{__version__}\n" | ||
|
||
|
||
def test_cli_config(script_runner, tmp_path): | ||
result = script_runner.run(["iact-estimator", "config", "--to", tmp_path]) | ||
assert result.returncode == 0 | ||
assert result.stderr == "You're halfway there! Have fun!\n" | ||
|
||
assert (tmp_path / "config.yml").is_file() | ||
|
||
|
||
def test_cli_run(script_runner, tmp_path): | ||
script_runner.run(["iact-estimator", "config", "--to", tmp_path]) | ||
result = script_runner.run( | ||
[ | ||
"iact-estimator", | ||
"run", | ||
"--config", | ||
tmp_path / "config.yml", | ||
"--source-name", | ||
"Crab Nebula", | ||
"--output-path", | ||
tmp_path, | ||
], | ||
) | ||
assert result.returncode == 0 |