WhisperJAV/tests
meizhong986 6647489484 test(upgrade): Add comprehensive automated tests for upgrade feature
Add 80 unit tests covering the upgrade system:

tests/test_upgrade_version_checker.py (44 tests):
- Version parsing (X.Y.Z, v-prefix, suffixes like .post4, -rc1)
- Version comparison logic
- Update notification levels (critical/major/minor/patch)
- Notification display timing and dismiss intervals
- HTTP request mocking with urllib.request
- Cache save/load/expiry behavior
- Windows installer asset URL detection
- Environment variable configuration overrides
- Integration tests simulating test stub repo responses

tests/test_upgrade_cli.py (36 tests):
- CLI argument parsing (--check, --yes, --wheel-only, --force, --version)
- Installation directory detection (sys.prefix, LOCALAPPDATA)
- Current version extraction via subprocess
- Network connectivity checking
- Package upgrade with mocked subprocess (success/failure/timeout)
- Wheel-only mode (--no-deps)
- Old version file cleanup
- CLI output formatting for update notifications
- Main entry point behavior
- Full upgrade flow integration tests

Testing approach:
- Uses unittest.mock for urllib.request (not responses library)
- pytest tmp_path fixture for directory isolation
- monkeypatch for environment variable and sys.prefix isolation
- MagicMock for subprocess calls to avoid real pip installs

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:46:18 +00:00
..
config Release v1.7.2: Speech segmentation tools and bug fixes 2025-12-11 10:24:57 +00:00
Reference_code_nemo_model_downloads_warmup.py bump to v1.7.2 with New Speech Segmenter + Ensemble UI revamp 2025-12-12 15:55:19 +00:00
diagnostic_S1_SONE966_crash_test.bat v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_S1_isolation_test.bat v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_crash_tracer_test.bat v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_param_variation_test.bat v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_param_variation_test.py v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_raw_faster_whisper_test.bat v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_raw_faster_whisper_test.py v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_single_param_test.bat v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_single_param_test.py v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_task_override_mutation_test.bat v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_task_override_mutation_test.py v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_verify_fix.py v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_whisperjav_pipeline_test.py v1.7.3 tests 2025-12-20 01:45:56 +00:00
diagnostic_workarounds_test.py v1.7.3 tests 2025-12-20 01:45:56 +00:00
hypothesis_configs.py reverts presets to 1.7.1 for sensitivity faster-whisper asr 2025-12-25 10:15:12 +00:00
hypothesis_test_suite.py reverts presets to 1.7.1 for sensitivity faster-whisper asr 2025-12-25 10:15:12 +00:00
inspect_hypothesis_configs.py reverts presets to 1.7.1 for sensitivity faster-whisper asr 2025-12-25 10:15:12 +00:00
reference_implementation_kotoba_transformers.py bug fixes from beta two 2025-12-02 20:27:29 +00:00
reference_transcription_test.py reverts presets to 1.7.1 for sensitivity faster-whisper asr 2025-12-25 10:15:12 +00:00
reference_transcription_test_v2.py reverts presets to 1.7.1 for sensitivity faster-whisper asr 2025-12-25 10:15:12 +00:00
run_ensemble_tests.bat Disable ClearVoice 48kHz model due to VRAM fragmentation on 8GB GPUs 2025-12-17 21:38:32 +00:00
run_ensemble_tests_v01.bat Disable ClearVoice 48kHz model due to VRAM fragmentation on 8GB GPUs 2025-12-17 21:38:32 +00:00
run_hypothesis_quickstart.bat reverts presets to 1.7.1 for sensitivity faster-whisper asr 2025-12-25 10:15:12 +00:00
run_hypothesis_quickstart.sh reverts presets to 1.7.1 for sensitivity faster-whisper asr 2025-12-25 10:15:12 +00:00
run_whisperjav_expanded_tests.bat Add test runner batch files for Windows 2025-12-18 13:20:36 +00:00
run_whisperjav_expanded_tests_v2-noenhancer-debug.bat Removed UnicodeEncoding arrow 2025-12-19 18:04:33 +00:00
run_whisperjav_expanded_tests_v2-nofidelity.bat Fix multiple issues: direct-to-english, defaults, lazy loading, tests 2025-12-18 17:00:31 +00:00
run_whisperjav_expanded_tests_v2.bat Fix multiple issues: direct-to-english, defaults, lazy loading, tests 2025-12-18 17:00:31 +00:00
run_whisperjav_single_pipeline_tests.bat Add test runner batch files for Windows 2025-12-18 13:20:36 +00:00
sample_ext_widgets_demo.ipynb kotoba-faster-whsiper pipeline alpha grade 2025-11-26 18:25:00 +00:00
srt_merge_tester_deepseek.py Fixed Ensemble Mode two-pass: naming convention 2025-12-05 18:46:15 +00:00
srt_merge_tester_gemini.py Fixed Ensemble Mode two-pass: naming convention 2025-12-05 18:46:15 +00:00
srt_merge_tester_gpt.py code incorrect in_gap calculation 2025-12-05 20:21:55 +00:00
test_async_cancellation.py Complete webview gui. Prior to remove old GUI 2025-10-31 13:08:43 +00:00
test_balanced_pipeline.py fidelity + balanced pipelines + requirements update 2025-11-16 15:59:41 +00:00
test_config_v4.py feat: Add v4 YAML-driven configuration system and Transformers pipeline 2025-11-29 01:30:26 +00:00
test_ensemble_merge.py Ensemble mode 2-pass refatored to two isolated subprocesses; Smart Merge algorithm modified; Cleasnup and memory management revamped 2025-12-05 13:13:42 +00:00
test_ensemble_params.py ensemble gui test and filter of scene detection parameter 2025-12-05 21:59:03 +00:00
test_gui_custom_params_simulation.py ensemble gui test and filter of scene detection parameter 2025-12-05 21:59:03 +00:00
test_gui_refactor.py Complete webview gui. Prior to remove old GUI 2025-10-31 13:08:43 +00:00
test_orchestrator_language.py Ensemble Mode two-pass: naming convention + tally + temp files 2025-12-05 17:53:46 +00:00
test_pass_worker_utils.py ensemble worker temp file cleanup 2025-12-07 00:07:37 +00:00
test_postprocessing_performance.py v1.7.2 bump and new tests 2025-12-13 17:27:18 +00:00
test_preflight_cuda_version.py Fix CUDA version comparison in preflight check 2025-11-06 18:08:20 +00:00
test_redos_all_patterns.py v1.7.2 bump and new tests 2025-12-13 17:27:18 +00:00
test_redos_repetition_cleaner.py v1.7.2 bump and new tests 2025-12-13 17:27:18 +00:00
test_redos_simple_demo.py v1.7.2 bump and new tests 2025-12-13 17:27:18 +00:00
test_repetition_cleaner.py Ensemble mode 2-pass refatored to two isolated subprocesses; Smart Merge algorithm modified; Cleasnup and memory management revamped 2025-12-05 13:13:42 +00:00
test_scene_detection_silero.py Performance audit: optimize aggressive params + add --dump-params 2025-12-06 11:37:13 +00:00
test_simple_gap.py Complete webview gui. Prior to remove old GUI 2025-10-31 13:08:43 +00:00
test_speech_enhancement_cli.py ffmpeg speech anhancer + fixed cuda empty bug 2025-12-15 01:12:11 +00:00
test_speech_segmentation.py bump to v1.7.2 with New Speech Segmenter + Ensemble UI revamp 2025-12-12 15:55:19 +00:00
test_speech_segmentation_player.py Fix test to use production config path (silero.py not asr_config.json) 2025-12-18 13:04:46 +00:00
test_speech_segmentation_visual.py bump to v1.7.2 with New Speech Segmenter + Ensemble UI revamp 2025-12-12 15:55:19 +00:00
test_tab_spacing.py Complete webview gui. Prior to remove old GUI 2025-10-31 13:08:43 +00:00
test_upgrade_cli.py test(upgrade): Add comprehensive automated tests for upgrade feature 2026-01-02 13:46:18 +00:00
test_upgrade_version_checker.py test(upgrade): Add comprehensive automated tests for upgrade feature 2026-01-02 13:46:18 +00:00
test_vad_failover.py Ensemble mode 2-pass refatored to two isolated subprocesses; Smart Merge algorithm modified; Cleasnup and memory management revamped 2025-12-05 13:13:42 +00:00
test_zipenhancer.py ffmpeg speech anhancer + fixed cuda empty bug 2025-12-15 01:12:11 +00:00
validate_hypothesis_suite.py reverts presets to 1.7.1 for sensitivity faster-whisper asr 2025-12-25 10:15:12 +00:00