Files
karaoke-gen/tests/unit
Andrew Beveridge ☄️andClaude Sonnet 5.5 5c30fde9b4 fix: reference lyrics truncated at 3000 chars (blank lines counted) (v0.285.2) (#1225)
## Summary
- `BaseLyricsProvider.MAX_LYRICS_LENGTH` (3000) was measured on raw
text. Genius RapidAPI emits `\n\n` per line, so a normal ~4 min song
(job 258ba59b, 4,256 chars) was truncated after verse 2.
Lrclib/Musixmatch hit the same cap (2,975 byte files).
- Blank lines no longer count toward the cap; cap raised to 15000
(screenplays/articles are 50k+).

## Testing
- New regressions: double-spaced 70-line song and ~8k-char rap song keep
every line; screenplay tests still truncate.
- `tests/unit/test_base_lyrics_provider.py` 17 pass. 9 failures in
test_lyrics.py / test_agentic_gemini_provider.py are pre-existing on
main (env).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Lyrics can now contain up to 15,000 characters before truncation, up
from 3,000.
* Blank lines no longer count toward the lyrics character limit, helping
preserve longer lyrics with extra spacing.

* **Documentation**
* Added guidance about the updated lyrics limit and a caution for
rerunning lyrics actions on in-progress jobs, where existing working
data may be replaced.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 15:17:05 -04:00
..
2025-12-27 22:36:22 -05:00

Unit Tests for KaraokePrep

This directory contains unit tests for the KaraokePrep class.

Test Files

The tests are organized into the following files:

  • test_initialization.py: Tests for initialization and basic functionality
  • test_file_operations.py: Tests for file operations (copy, download, convert)
  • test_metadata.py: Tests for metadata extraction and parsing
  • test_lyrics.py: Tests for lyrics processing
  • test_audio.py: Tests for audio processing and separation
  • test_video.py: Tests for video creation and processing
  • test_async.py: Tests for async methods

Running the Tests

To run the tests, you need to have the test dependencies installed:

pip install -r requirements-test.txt

Then you can run the tests with:

python run_tests.py

This will run all the tests and generate a coverage report.

Checking Test Files

If you want to check if the test files are valid Python code without running the tests, you can use:

python check_tests.py

This will check if all the test files can be imported without errors.

Test Coverage

The tests aim to cover all the functionality of the KaraokePrep class. The coverage report will show you which parts of the code are covered by the tests.