mirror of
https://github.com/beetbox/beets.git
synced 2026-07-22 02:06:50 -04:00
- Handle formats as strings ONLY and evaluate them through a shared cached template helper. - This removes the need for conditional logic that acts on Template objects or strings.
16 lines
558 B
Python
16 lines
558 B
Python
from beets.util.pathformats import get_path_formats
|
|
|
|
|
|
def test_get_path_formats(config):
|
|
"""Ensure the function prepends custom and preserves defaults."""
|
|
# override the default 'singleton' path and add a new one
|
|
config["paths"].set({"singleton": "bar", "new": "hello"})
|
|
|
|
assert get_path_formats(config["paths"]) == [
|
|
("singleton:true", "bar"),
|
|
("new", "hello"),
|
|
# defaults
|
|
("default", "$albumartist/$album%aunique{}/$track $title"),
|
|
("comp:true", "Compilations/$album%aunique{}/$track $title"),
|
|
]
|