Skip to content

Commit

Permalink
chg: unittest work now
Browse files Browse the repository at this point in the history
  • Loading branch information
bossjones committed May 5, 2024
1 parent d8eb106 commit cd36b01
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/goob_ai/aio_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class AioSettings(BaseSettings):
token: str = ""
prefix: str = "/"

discord_admin_user_id: str = ""
discord_admin_user_id: int | None = None

discord_general_channel: int = 908894727779258390

Expand Down
8 changes: 7 additions & 1 deletion src/goob_ai/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ def version_callback(version: bool) -> None:
raise typer.Exit()


@APP.command()
def version() -> None:
"""version command"""
rich.print(f"goob_ai version: {goob_ai.__version__}")


@APP.command()
def about() -> None:
"""about command"""
Expand Down Expand Up @@ -220,7 +226,7 @@ async def run_bot():

@APP.command()
def go() -> None:
"""Main entry point for goobbot"""
"""Main entry point for GoobAI"""
typer.echo("Starting up GoobAI Bot")
asyncio.run(run_bot())

Expand Down
7 changes: 4 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ class TestApp:

def test_version(self) -> None:
"""Test the version command."""
result = runner.invoke(APP, ["--version"])
result = runner.invoke(APP, ["version"])
assert result.exit_code == 0
assert "goob_ai version:" in result.stdout

def test_help(self) -> None:
"""Test the help command."""
result = runner.invoke(APP, ["--help"])
assert result.exit_code == 0
assert "goob_ai: A Python package for the Transport for London (TFL) API." in result.stdout

assert "about command" in result.stdout
assert "Main entry point for GoobAI" in result.stdout
assert "version command" in result.stdout

def test_about(self) -> None:
"""Test the help command."""
Expand Down

0 comments on commit cd36b01

Please sign in to comment.