Files
beets/test/util/test_pathformats.py
Šarūnas Nejus 3e9ea8ebe8 Refactor template evaluation to handle format strings ONLY
- 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.
2026-07-03 09:56:39 +01:00

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"),
]