Classify static and smart crates
This commit is contained in:
@@ -3,12 +3,14 @@ from pathlib import Path
|
||||
import pytest
|
||||
|
||||
from serato_doctor.crate_parser import (
|
||||
classify_crate,
|
||||
clean_path,
|
||||
load_crate,
|
||||
parse_crate,
|
||||
parse_crates,
|
||||
path_markers,
|
||||
)
|
||||
from serato_doctor.models.crate import CrateKind
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -84,3 +86,18 @@ def test_parse_crates_reuses_configured_roots_for_every_crate(tmp_path):
|
||||
"First.mp3",
|
||||
"Second.mp3",
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("relative_path", "expected"),
|
||||
[
|
||||
("_Serato_/Subcrates/House.crate", CrateKind.STATIC),
|
||||
("_Serato_/Smartcrates/Warmup.crate", CrateKind.SMART),
|
||||
("_Serato_/Subcrates/Compatible by key.crate", CrateKind.SMART),
|
||||
("fixtures/Unknown.crate", CrateKind.UNKNOWN),
|
||||
],
|
||||
)
|
||||
def test_classify_crate_uses_provenance_and_known_dynamic_name(
|
||||
tmp_path, relative_path, expected
|
||||
):
|
||||
assert classify_crate(tmp_path / relative_path) is expected
|
||||
|
||||
Reference in New Issue
Block a user