🐛 fix(__main__.py): rename serve command to run command for better semantics and clarity

🔧 chore(test_cli.py): update test to use the new run command instead of serve command
✨ feat(test_cli.py): add test for creating a superuser with the superuser command
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-28 15:47:57 -03:00
commit 137954de6b
2 changed files with 17 additions and 2 deletions

View file

@ -95,7 +95,7 @@ def serve_on_jcloud():
@app.command()
def serve(
def run(
host: str = typer.Option(
"127.0.0.1", help="Host to bind the server to.", envvar="LANGFLOW_HOST"
),
@ -326,7 +326,16 @@ def superuser(
from langflow.services.auth.utils import create_super_user
if create_super_user(session, username, password):
# Verify that the superuser was created
from langflow.services.database.models.user.user import User
user = session.query(User).filter(User.username == username).first()
if user is None:
typer.echo("Superuser creation failed.")
return
typer.echo("Superuser created successfully.")
else:
typer.echo("Superuser creation failed.")