mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-12-01 01:31:32 +09:00
## Summary - Fix FFmpeg failing on paths with apostrophes (e.g., "I'm With You") - Use single-quote wrapping with `'\''` pattern for embedded quotes - Update both `video.py` and `video_background_processor.py` ## Test plan - [x] Unit tests updated and passing (1006 tests) - [x] E2E tests passing (68 tests) - [x] Manually tested with "Avril Lavigne - I'm With You" - video generates successfully ## Technical details FFmpeg filter syntax interprets apostrophes as special characters. Simple backslash escaping (`\'`) doesn't work because FFmpeg's filter parser consumes the backslash. The solution is to wrap paths in single quotes and escape embedded quotes using the `'\''` pattern (end quote, literal quote, start quote). Example: `I'm With You` becomes `'I'\''m With You'` @coderabbitai ignore 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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 functionalitytest_file_operations.py: Tests for file operations (copy, download, convert)test_metadata.py: Tests for metadata extraction and parsingtest_lyrics.py: Tests for lyrics processingtest_audio.py: Tests for audio processing and separationtest_video.py: Tests for video creation and processingtest_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.