diff --git a/.readthedocs.yml b/.readthedocs.yml index ebdc665..8f9020d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.11" + python: "3.12" sphinx: configuration: docs/conf.py diff --git a/tests/test_tsellm.py b/tests/test_tsellm.py index f4a47e6..9c72f0f 100644 --- a/tests/test_tsellm.py +++ b/tests/test_tsellm.py @@ -1,12 +1,9 @@ from sqlite_utils import Database - +import llm from tsellm.cli import cli -import pytest -import datetime -from click.testing import CliRunner -def test_cli(db_path): +def test_tsellm_cli(db_path): db = Database(db_path) assert [] == db.table_names() table = db.create_table( @@ -28,3 +25,10 @@ def test_cli(db_path): ("hello",), ("world",), ] + + cli([db_path, "UPDATE prompts SET generated=prompt(prompt)"]) + + assert db.execute("select prompt, generated from prompts").fetchall() == [ + ("hello", "hellohello"), + ("world", "worldworld"), + ] diff --git a/tsellm/cli.py b/tsellm/cli.py index 3836be5..2926826 100644 --- a/tsellm/cli.py +++ b/tsellm/cli.py @@ -126,5 +126,3 @@ def cli(*args): console.interact(banner, exitmsg="") finally: con.close() - - sys.exit(0)