Skip to content

Commit

Permalink
Stub out the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
grampajoe committed Feb 15, 2015
1 parent 4adff9f commit 6df53c8
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 12 deletions.
3 changes: 0 additions & 3 deletions happy.py

This file was deleted.

Empty file added happy/__init__.py
Empty file.
9 changes: 9 additions & 0 deletions happy/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""
The command-line interface for happy!
"""
import click


@click.group(name='happy')
def cli():
"""Quickly set up and tear down Heroku apps!"""
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@
author_email="joe@joefriedl.net",
url="https://github.com/grampajoe/happy",
description="Quickly set up and tear down Heroku apps!",
install_requires=[
'click'
],
entry_points="""
[console_scripts]
happy=happy.cli:cli
""",
packages=find_packages(exclude=['tests'])
)
8 changes: 0 additions & 8 deletions tests.py

This file was deleted.

Empty file added tests/__init__.py
Empty file.
16 changes: 16 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
Tests for the cli commands.
"""
from click.testing import CliRunner

from happy.cli import cli


def test_help():
"""Running happy should print the help."""
runner = CliRunner()

result = runner.invoke(cli)

assert result.exit_code == 0
assert 'Usage: happy' in result.output
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
envlist = py27, py34, pypy

[testenv]
commands = py.test tests.py --cov happy --pep8 happy.py
commands = py.test tests/ --cov happy --pep8 .
deps =
pytest
pytest-cov
Expand Down

0 comments on commit 6df53c8

Please sign in to comment.