Skip to content

Commit

Permalink
Show actual program versions in quiet output
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Apr 18, 2020
1 parent 7113ee2 commit 9108f40
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,7 @@

- Added support for unicode characters in Python 3.8.
- Added `--vendor PATH` command to download the program for offline use.
- Updated `--quiet` output to include actual program versions.

# 3.0.2 (2020-01-06)

Expand Down
10 changes: 9 additions & 1 deletion tests/test_cli.py
Expand Up @@ -234,11 +234,19 @@ def it_shows_failing_programs(cli, tmp_path):
cli = working-program
version = 1.3
[Missing Program]
cli = missing-program
version = 1.2.3
"""
)

cmd = cli('--root', str(tmp_path), '--quiet')

expect(cmd.stderr) == ""
expect(cmd.stdout) == "Unmatched Newer Working Program version: 1.3\n"
expect(cmd.stdout) == (
"Newer Working Program: 1.2.3, EXPECTED: 1.3\n"
"Missing Program: Not found, EXPECTED: 1.2.3\n"
)
expect(cmd.returncode) == 0
11 changes: 6 additions & 5 deletions verchew/script.py
Expand Up @@ -252,11 +252,12 @@ def check_dependencies(config):
success.append(_("?"))
else:
if QUIET:
print(
"Unmatched {0} version: {1}".format(
name, settings['version'] or "<anything>"
)
)
if "not found" in output:
actual = "Not found"
else:
actual = output.split('\n')[0].strip('.')
expected = settings['version'] or "<anything>"
print("{0}: {1}, EXPECTED: {2}".format(name, actual, expected))
show(
_("x")
+ " EXPECTED: {0}".format(settings['version'] or "<anything>")
Expand Down

0 comments on commit 9108f40

Please sign in to comment.