Skip to content

Commit

Permalink
feat: Add tests to confirm functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasyager committed Mar 23, 2024
1 parent 154cd51 commit 6763a65
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/integration/test_cli_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from click.testing import CliRunner

from dbt_meshify.cli import get_version
from dbt_meshify.main import cli


def test_version_option():
"""When the --version option is passed, meshify returns the version and exits."""

runner = CliRunner()
result = runner.invoke(
cli,
[
"--version",
],
)

assert result.exit_code == 0
assert result.stdout.rstrip() == get_version()


def test_no_command_prints_help():
"""When an invoked subcommand is not provided, print the help and exit."""

runner = CliRunner()
result = runner.invoke(cli)

assert result.exit_code == 0

help_result = result = runner.invoke(cli, ["--help"])
assert result.stdout == help_result.stdout

0 comments on commit 6763a65

Please sign in to comment.