Add unit tests for CLI to increase code coverage + fix bug

When running `llama stack run`, using `config` instead of `--config` causes an error. This is now fixed and tested with unit tests.

Unit test coverage has been added to the basic CLI argparsing.

Signed-off-by: Courtney Pacheco <6019922+courtneypacheco@users.noreply.github.com>
This commit is contained in:
Courtney Pacheco 2025-03-10 21:15:02 -04:00
parent ff853ccc38
commit 6beb80f2ac
3 changed files with 706 additions and 2 deletions

View file

@ -230,5 +230,9 @@ def test_chat_completion_doesnt_block_event_loop(caplog):
# records from our chat completion call. A message gets logged
# here any time we exceed the slow_callback_duration configured
# above.
asyncio_warnings = [record.message for record in caplog.records if record.name == "asyncio"]
asyncio_warnings = [
record.message
for record in caplog.records
if record.name == "asyncio" and "Executing <Task" not in record.message
]
assert not asyncio_warnings