Skip to content

Commit

Permalink
Add tests for exit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
suchow committed Mar 31, 2016
1 parent 7c786c2 commit 19db464
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_exit_codes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Check that the CLI returns the appropriate exit code."""

import subprocess


def test_exit_code_demo():
"""Ensure that linting the demo returns an exit code of 1."""
try:
subprocess.check_output("proselint --demo", shell=True)

except subprocess.CalledProcessError as grepexc:
assert(grepexc.returncode == 1)


def test_exit_code_version():
"""Ensure that getting the version returns an exit code of 0."""
try:
subprocess.check_output("proselint --version", shell=True)

except subprocess.CalledProcessError:
assert(False)

0 comments on commit 19db464

Please sign in to comment.