tests: PEP8 cleanup
This commit is contained in:
parent
309e1b8247
commit
c1d021ccaf
1 changed files with 18 additions and 4 deletions
|
@ -1,37 +1,51 @@
|
|||
""" Validate task-status options """
|
||||
from click.testing import CliRunner
|
||||
from task_status.task_status import main as task_main
|
||||
from task_status.task_status import __version__ as task_version
|
||||
from click.testing import CliRunner
|
||||
|
||||
runner = CliRunner()
|
||||
|
||||
|
||||
def test_main():
|
||||
if task_main:
|
||||
response = runner.invoke(task_main)
|
||||
assert response.exit_code == 0
|
||||
"""Validate the basic command runs with a successful response"""
|
||||
response = runner.invoke(task_main)
|
||||
assert response.exit_code == 0
|
||||
|
||||
|
||||
def test_version():
|
||||
"""Verify that --version outputs the version and it matches
|
||||
what the code says it should be"""
|
||||
response = runner.invoke(task_main, ["--version"])
|
||||
assert response.exit_code == 0
|
||||
assert task_version in response.output
|
||||
|
||||
|
||||
def test_uuid():
|
||||
"""Validate the --uuid option returns successfully"""
|
||||
response = runner.invoke(task_main, ["--uuid"])
|
||||
assert response.exit_code == 0
|
||||
|
||||
|
||||
def test_sort():
|
||||
"""Validate --sort returns successfully"""
|
||||
response = runner.invoke(task_main, ["--sort"])
|
||||
assert response.exit_code == 0
|
||||
|
||||
|
||||
def test_header():
|
||||
"""Validate --header returns successfully"""
|
||||
response = runner.invoke(task_main, ["--header"])
|
||||
assert response.exit_code == 0
|
||||
|
||||
|
||||
def test_help():
|
||||
"""Validate --help returns successfully"""
|
||||
response = runner.invoke(task_main, ["--help"])
|
||||
assert response.exit_code == 0
|
||||
|
||||
|
||||
def test_invalid_option():
|
||||
"""Validate pasing a bad option returns an error"""
|
||||
# check that task fails successfully!"
|
||||
response = runner.invoke(task_main, ["--invalid"])
|
||||
assert response.exit_code == 2
|
||||
|
|
Loading…
Reference in a new issue