feat(config): make music base path configurable via env var
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.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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}"
|
||||
Reference in New Issue
Block a user