Skip to content

Feature/jesus garcia #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions mysupercliproject/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ def hello(_: Info):
"""Say 'hello' to the nice people."""
click.echo("mysupercliproject says 'hello'")

@cli.command()
@pass_info
def company_greeting(_: Info):
"""Say 'hello' to the nice people."""
company = "Dataminded"
click.echo(f"{company} says 'hello'")

@cli.command()
def version():
Expand Down
12 changes: 12 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,15 @@ def test_hello_displays_expected_message():
assert 'mysupercliproject' in result.output.strip(), \
"'Hello' messages should contain the CLI name."
# fmt: on

def test_company_greetings_displays_expected_message(company):
"""
Arrange/Act: Run the `version` subcommand.
Assert: The output matches the library version.
"""
runner: CliRunner = CliRunner()
result: Result = runner.invoke(cli.cli, ["company_greeting"])
# fmt: off
assert company in result.output.strip(), \
"Company greeting messages should contain the company name."
# fmt: on