Skip to content

test(cli): add tests for tokenize and audit subcommands - #22

Merged
fufuchiu merged 2 commits into
fufuchiu:mainfrom
interview35:test-cli-subcommands
Sep 10, 2026
Merged

fufuchiu merged 2 commits into
fufuchiu:mainfrom
interview35:test-cli-subcommands

Conversation

@interview35

Copy link
Copy Markdown
Contributor

The cli.py module had zero test coverage. This adds a new tests/test_cli.py with 7 tests exercising both subcommands:

  • tokenize without --audio-codes encodes text with BOS/EOS boundaries
  • tokenize with --audio-codes packs text + separator + audio tokens
  • tokenize handles multi-byte UTF-8 characters correctly
  • tokenize with empty text produces just BOS and EOS
  • audit prints conversation and turn counts from a valid JSONL file
  • audit with a nonexistent manifest exits with code 2
  • Missing subcommand exits with code 2

All 7 tests pass locally (pytest tests/test_cli.py -q).

@fufuchiu
fufuchiu merged commit e1c0f56 into fufuchiu:main Sep 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants