test: cover audio, sequences, pattern direction, and settings
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
30
tests/test_sequence_playback_loop.py
Normal file
30
tests/test_sequence_playback_loop.py
Normal file
@@ -0,0 +1,30 @@
|
||||
"""Sequence playback loop flag coercion."""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
SRC_PATH = os.path.join(PROJECT_ROOT, "src")
|
||||
if SRC_PATH not in sys.path:
|
||||
sys.path.insert(0, SRC_PATH)
|
||||
|
||||
from util.sequence_playback import ( # noqa: E402
|
||||
_coerce_loop,
|
||||
_ordered_unique_preset_ids_in_lane,
|
||||
)
|
||||
|
||||
|
||||
def test_coerce_loop():
|
||||
assert _coerce_loop({"loop": True}) is True
|
||||
assert _coerce_loop({"loop": False}) is False
|
||||
assert _coerce_loop({"sequence_loop": 0}) is False
|
||||
assert _coerce_loop({}) is True
|
||||
|
||||
|
||||
def test_ordered_unique_preset_ids_in_lane():
|
||||
lane = [
|
||||
{"preset_id": "6", "beats": 1},
|
||||
{"preset_id": "4", "beats": 2},
|
||||
{"preset_id": "6", "beats": 1},
|
||||
]
|
||||
assert _ordered_unique_preset_ids_in_lane(lane) == ["6", "4"]
|
||||
Reference in New Issue
Block a user