Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,26 @@ def test_main_with_options(self):
self.assertEqual(args.max_bpm, 200.0)


@patch("bpm_detector.cli.analyze_file_with_progress")
@patch("os.path.exists")
def test_main_quiet_option(self, mock_exists, mock_analyze):
"""Test that --quiet disables progress display."""
mock_exists.return_value = True

test_args = ["bpm-detector", "--quiet", "test.wav"]

with patch("sys.argv", test_args):
with patch("sys.stdout", io.StringIO()):
main()

# Should call analyze_file_with_progress once
mock_analyze.assert_called_once()

# Args should have progress disabled
call_args = mock_analyze.call_args[0]
args = call_args[2]
self.assertFalse(args.progress)


if __name__ == "__main__":
unittest.main()
Loading