返回 MoneyPrinterTurbo
README.md
根目录 / test / README.md
1 # MoneyPrinterTurbo Test Directory
2
3 This directory contains unit tests for the **MoneyPrinterTurbo** project.
4
5 ## Directory Structure
6
7 - `services/`: Tests for components in the `app/services` directory
8 - `test_video.py`: Tests for the video service
9 - `test_task.py`: Tests for the task service
10 - `test_voice.py`: Tests for the voice service
11
12 ## Running Tests
13
14 You can run the tests using Python’s built-in `unittest` framework:
15
16 ```bash
17 # Run all tests
18 python -m unittest discover -s test
19
20 # Run a specific test file
21 python -m unittest test/services/test_video.py
22
23 # Run a specific test class
24 python -m unittest test.services.test_video.TestVideoService
25
26 # Run a specific test method
27 python -m unittest test.services.test_video.TestVideoService.test_preprocess_video
28 ````
29
30 Live provider tests are skipped by default. To run tests that may call external
31 TTS or LLM services, set `MPT_RUN_INTEGRATION_TESTS=1` and provide the required
32 provider credentials.
33
34 ## Adding New Tests
35
36 To add tests for other components, follow these guidelines:
37
38 1. Create test files prefixed with `test_` in the appropriate subdirectory
39 2. Use `unittest.TestCase` as the base class for your test classes
40 3. Name test methods with the `test_` prefix
41
42 ## Test Resources
43
44 Place any resource files required for testing in the `test/resources` directory.
45
45 lines MARKDOWN