1e53178676
hardcoded ~/Music path broke on any non-standard setup. `music_base_path` on root CLI and `Command` base reads from $MUSIC_BASE_PATH. `seasons()` and `current_quarter()` now take the path explicitly. adds .env.example, .envrc, and a pytest covering --help output.
17 lines
445 B
Python
17 lines
445 B
Python
import pytest
|
|
from io import StringIO
|
|
from contextlib import redirect_stdout
|
|
|
|
from pydantic_settings import CliApp
|
|
|
|
from music.cli import Cli
|
|
|
|
|
|
def test_help_shows_music_dir():
|
|
buf = StringIO()
|
|
with pytest.raises(SystemExit):
|
|
with redirect_stdout(buf):
|
|
CliApp.run(Cli, cli_args=["--help"])
|
|
output = buf.getvalue()
|
|
assert "--music-base-path" in output, f"--music-base-path not found in help output:\n{output}"
|