Skip to content

Commit

Permalink
Updated version output check
Browse files Browse the repository at this point in the history
  • Loading branch information
dogversioning committed Feb 11, 2025
1 parent 658ff62 commit b5893d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cumulus_library/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def main(cli_args=None):
sys.exit(1)

if args["action"] == "version":
table = rich.table.Table(title=f"cumulus library version: {__version__}")
table = rich.table.Table(title=f"cumulus-library version: {__version__}")
table.add_column("Study Name", style="green")
table.add_column("Version", style="blue")
studies = get_study_dict(args.get("study_dir"))
Expand Down
9 changes: 7 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,13 @@ def test_version(capfd):
)
out, _ = capfd.readouterr()
assert f"cumulus-library version: {__version__}" in out
assert "study_valid: 1.0.0" in out
assert "study_invalid_bad_query: no version defined" in out
out = out.split("\n")
valid = list(filter(lambda x: " study_valid " in x, out))
assert len(valid) == 1
assert " 1.0.0 " in valid[0]
invalid = list(filter(lambda x: " study_invalid_bad_query " in x, out))
assert len(invalid) == 1
assert " No version defined " in invalid[0]


@mock.patch.dict(
Expand Down

0 comments on commit b5893d7

Please sign in to comment.